]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. V_3_6 anongit/V_3_6 github-selfhosted/V_3_6 github/V_3_6 V_3_6_P1
authorDamien Miller <djm@mindrot.org>
Wed, 26 Mar 2003 05:03:05 +0000 (16:03 +1100)
committerDamien Miller <djm@mindrot.org>
Wed, 26 Mar 2003 05:03:05 +0000 (16:03 +1100)
   Report from murple@murple.net, diagnosis from dtucker@zip.com.au

ChangeLog
openbsd-compat/fake-getaddrinfo.c

index cdcd73df3ebc0defd430ca0619e03d9ef9f2c41e..9a7e2ea93a39c9827d4960a3c3429e2a2dbe2084 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@
      srp@srparish.net, help from djm
  - (djm) Fix getpeerid support for 64 bit BE systems. From 
     Arnd Bergmann <arndb@de.ibm.com>
+ - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
+   Report from murple@murple.net, diagnosis from dtucker@zip.com.au
  - Release 3.6p1
 
 20030324
      save auth method before monitor_reset_key_state(); bugzilla bug #284;
      ok provos@
 
-$Id: ChangeLog,v 1.2633.2.8 2003/03/26 05:02:47 djm Exp $
+$Id: ChangeLog,v 1.2633.2.9 2003/03/26 05:03:05 djm Exp $
index e04776606480e869e2c4ba60e43df3188a616be3..bc58f30a647a458966fa553a57d11c7eeb815087 100644 (file)
@@ -12,7 +12,7 @@
 #include "includes.h"
 #include "ssh.h"
 
-RCSID("$Id: fake-getaddrinfo.c,v 1.4 2003/02/24 01:35:09 djm Exp $");
+RCSID("$Id: fake-getaddrinfo.c,v 1.4.2.1 2003/03/26 05:03:06 djm Exp $");
 
 #ifndef HAVE_GAI_STRERROR
 char *gai_strerror(int ecode)
@@ -71,6 +71,7 @@ int getaddrinfo(const char *hostname, const char *servname,
        struct in_addr in;
        int i;
        long int port;
+       u_long addr;
 
        port = 0;
        if (servname != NULL) {
@@ -86,7 +87,10 @@ int getaddrinfo(const char *hostname, const char *servname,
        }
 
        if (hints && hints->ai_flags & AI_PASSIVE) {
-               if (NULL != (*res = malloc_ai(port, htonl(0x00000000))))
+               addr = htonl(0x00000000);
+               if (hostname && inet_aton(hostname, &in) != 0)
+                       addr = in.s_addr;
+               if (NULL != (*res = malloc_ai(port, addr)))
                        return 0;
                else
                        return EAI_MEMORY;