]> andersk Git - openssh.git/commitdiff
- Don't permanently fail on bind() if getaddrinfo has more choices left for
authordamien <damien>
Fri, 3 Mar 2000 11:35:33 +0000 (11:35 +0000)
committerdamien <damien>
Fri, 3 Mar 2000 11:35:33 +0000 (11:35 +0000)
   us. Needed to work around messy IPv6 on Linux. Patch from Arkadiusz
   Miskiewicz <misiek@pld.org.pl>

CREDITS
ChangeLog
channels.c
sshd.c

diff --git a/CREDITS b/CREDITS
index 08d160cb97fa60c4c002f2bbfff3a83cfc4562e1..234bc117851938fc3a491d27c2d7f56df035cea6 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -6,6 +6,7 @@ Theo de Raadt, and Dug Song - Creators of OpenSSH
 Andrew Stribblehill <a.d.stribblehill@durham.ac.uk> - Bugfixes
 Andre Lucas <andre.lucas@dial.pipex.com> - build, login and many other fixes
 Andy Sloane <andy@guildsoftware.com> - bugfixes
+Arkadiusz Miskiewicz <misiek@pld.org.pl> - IPv6 compat fixes
 Ben Taylor <bent@clark.net> - Solaris debugging and fixes
 Chip Salzenberg <chip@valinux.com> - Assorted patches
 Chris Saia <csaia@wtower.com> - SuSE packaging
index a0afccb2c9ef026d26b1e4fdc7d71669cb7847a0..735444f1c86888f6be4c3bf8c0f912b4899d2306 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
 20000303
  - Added "make host-key" target, Suggestion from Dominik Brettnacher
  <domi@saargate.de>
+ - Don't permanently fail on bind() if getaddrinfo has more choices left for 
+   us. Needed to work around messy IPv6 on Linux. Patch from Arkadiusz
+   Miskiewicz <misiek@pld.org.pl>
 
 20000302
  - Big cleanup of autoconf code
index 21ac10a24a28e623f79f2aa510f67f38ac653862..5fe4e5277cf51de13f6e5b841ae124dc3e3aec55 100644 (file)
@@ -935,7 +935,11 @@ channel_request_local_forwarding(u_short port, const char *host,
                /* Bind the socket to the address. */
                if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
                        /* address can be in use ipv6 address is already bound */
-                       verbose("bind: %.100s", strerror(errno));
+                       if (!ai->ai_next)
+                               error("bind: %.100s", strerror(errno));
+                       else
+                               verbose("bind: %.100s", strerror(errno));
+                               
                        close(sock);
                        continue;
                }
@@ -1199,6 +1203,10 @@ x11_create_display_inet(int screen_number, int x11_display_offset)
                                debug("bind port %d: %.100s", port, strerror(errno));
                                shutdown(sock, SHUT_RDWR);
                                close(sock);
+
+                               if (ai->ai_next)
+                                       continue;
+
                                for (n = 0; n < num_socks; n++) {
                                        shutdown(socks[n], SHUT_RDWR);
                                        close(socks[n]);
diff --git a/sshd.c b/sshd.c
index f49b453684352ac74099a715b908d6c8e3cd2217..0024440ed693855de09894d0695ec176a7173b73 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -558,7 +558,8 @@ main(int ac, char **av)
                        debug("Bind to port %s on %s.", strport, ntop);
 
                        /* Bind the socket to the desired port. */
-                       if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) {
+                       if ((bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) &&
+                                (!ai->ai_next)) {
                                error("Bind to port %s on %s failed: %.200s.",
                                    strport, ntop, strerror(errno));
                                close(listen_sock);
This page took 0.076156 seconds and 5 git commands to generate.