Binary files openssh-4.3p2-orig/.servconf.c.swp and openssh-4.3p2/.servconf.c.swp differ
diff -ur openssh-4.3p2-orig/servconf.c openssh-4.3p2/servconf.c
--- openssh-4.3p2-orig/servconf.c	2006-07-31 16:23:34.000000000 -0400
+++ openssh-4.3p2/servconf.c	2006-07-31 17:19:46.000000000 -0400
@@ -25,6 +25,7 @@
 
 static void add_listen_addr(ServerOptions *, char *, u_short);
 static void add_one_listen_addr(ServerOptions *, char *, u_short);
+static void add_listen_iface(ServerOptions *, char *);
 
 /* Use of privilege separation or not */
 extern int use_privsep;
@@ -278,7 +279,7 @@
 	sClientAliveCountMax, sAuthorizedKeysFile, sAuthorizedKeysFile2,
 	sGssAuthentication, sGssKeyEx, sGssCleanupCreds, 
 	sAcceptEnv, sPermitTunnel,
-	sUsePrivilegeSeparation,
+	sUsePrivilegeSeparation, sListenInterface,
 	sDeprecated, sUnsupported
 } ServerOpCodes;
 
@@ -383,6 +384,7 @@
 	{ "useprivilegeseparation", sUsePrivilegeSeparation},
 	{ "acceptenv", sAcceptEnv },
 	{ "permittunnel", sPermitTunnel },
+	{ "listeninterface", sListenInterface },
 	{ NULL, sBadOption }
 };
 
@@ -443,6 +445,76 @@
 	options->listen_addrs = aitop;
 }
 
+static void 
+add_listen_iface(ServerOptions *options, char *iface) 
+{
+  struct ifconf ifaces;
+  size_t i, iface_buf_size, iface_len;
+  char *name, buf[32];
+  int sock, wildcard;
+  u_int32_t addr;
+
+  wildcard = 0;
+  iface_len = strlen(iface);
+
+  /* wildcard match */
+  if (iface[iface_len - 1] == '*') {
+    wildcard = 1;
+    iface_len--;
+  }
+
+  /* create new socket */
+  if ((sock = socket(PF_INET, SOCK_STREAM, 0)) < 0)
+    fatal("couldn't create socket");
+
+  /* clear ioctl buffer */
+  memset(&ifaces, 0, sizeof(struct ifconf));
+
+  /* calculate size */
+  iface_buf_size = sizeof(struct ifreq) * MAX_LISTEN_IFACES;
+  ifaces.ifc_len = iface_buf_size;
+
+  /* allocate memory for interface list */
+  if ((ifaces.ifc_req = malloc(iface_buf_size)) == NULL)
+    fatal("couldn't allocate interface buffer.");
+  memset(ifaces.ifc_req, 0, iface_buf_size);
+  
+  /* get list of interfaces */
+  if (ioctl(sock, SIOCGIFCONF, &ifaces))
+    fatal("couldn't get address list");
+
+  /* iterate over list of interfaces and print out addresses associated
+   * with each one */
+  for (i = 0; i < (ifaces.ifc_len / sizeof(struct ifreq)); i++) {
+    /* grab interface name */
+    name = ifaces.ifc_req[i].ifr_name;
+
+    /* compare the interface name against argument.  if the argument
+     * doesn't match the interface name, then skip it.
+     */
+    if (iface && (iface_len > strlen(name) || (wildcard ? memcmp(iface, name, iface_len) : strncmp(iface, name, iface_len + 1))))
+      continue;
+
+    /* grab address */
+    addr = ((struct sockaddr_in*) &(ifaces.ifc_req[i].ifr_addr))->sin_addr.s_addr;
+
+    /* create IP address (XXX: not endian safe) */
+    snprintf(buf, sizeof(buf), "%d.%d.%d.%d", 
+      (addr & 0x000000ff) >> 0,
+      (addr & 0x0000ff00) >> 8,
+      (addr & 0x00ff0000) >> 16,
+      (addr & 0xff000000) >> 24
+    );
+
+    /* add listen address */
+    add_listen_addr(options, buf, 0);
+  }
+
+  /* free interface list, then shut down socket (silently ignore err) */
+  free(ifaces.ifc_req);
+  shutdown(sock, SHUT_RDWR);
+}
+
 int
 process_server_config_line(ServerOptions *options, char *line,
     const char *filename, int linenum)
@@ -547,6 +619,15 @@
 
 		break;
 
+	case sListenInterface:
+		arg = strdelim(&cp);
+		if (arg == NULL || *arg == '\0')
+			fatal("%s line %d: missing interface",
+			    filename, linenum);
+		add_listen_iface(options, arg);
+
+		break;
+
 	case sAddressFamily:
 		arg = strdelim(&cp);
 		if (!arg || *arg == '\0')
diff -ur openssh-4.3p2-orig/servconf.h openssh-4.3p2/servconf.h
--- openssh-4.3p2-orig/servconf.h	2006-07-31 16:23:34.000000000 -0400
+++ openssh-4.3p2/servconf.h	2006-07-31 17:13:28.000000000 -0400
@@ -27,6 +27,7 @@
 #define MAX_SUBSYSTEMS		256	/* Max # subsystems. */
 #define MAX_HOSTKEYS		256	/* Max # hostkeys. */
 #define MAX_ACCEPT_ENV		256	/* Max # of env vars. */
+#define MAX_LISTEN_IFACES 32 /* Max # of listen interfaces */
 
 /* permit_root_login */
 #define	PERMIT_NOT_SET		-1
diff -ur openssh-4.3p2-orig/ssh.h openssh-4.3p2/ssh.h
--- openssh-4.3p2-orig/ssh.h	2004-12-06 06:47:42.000000000 -0500
+++ openssh-4.3p2/ssh.h	2006-07-31 17:15:25.000000000 -0400
@@ -16,6 +16,7 @@
 #define SSH_H
 
 #include <netinet/in.h> /* For struct sockaddr_in */
+#include <net/if.h>
 #include <pwd.h> /* For struct pw */
 #include <stdarg.h> /* For va_list */
 #include <syslog.h> /* For LOG_AUTH and friends */

