summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-03-03 22:35:33 +1100
committerDamien Miller <djm@mindrot.org>2000-03-03 22:35:33 +1100
commit3c7eeb2af5e97c074ea1ba29f1ebe7a2d710ea48 (patch)
tree69d1e7af0853de884c742c0be1c37aa0fa02f13f
parent4095f894dce73a9024493c81190f786b64672c4a (diff)
- 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>
-rw-r--r--CREDITS1
-rw-r--r--ChangeLog3
-rw-r--r--channels.c12
-rw-r--r--sshd.c3
4 files changed, 16 insertions, 3 deletions
diff --git a/CREDITS b/CREDITS
index 08d160cb9..234bc1178 100644
--- a/CREDITS
+++ b/CREDITS
@@ -6,6 +6,7 @@ Theo de Raadt, and Dug Song - Creators of OpenSSH
6Andrew Stribblehill <a.d.stribblehill@durham.ac.uk> - Bugfixes 6Andrew Stribblehill <a.d.stribblehill@durham.ac.uk> - Bugfixes
7Andre Lucas <andre.lucas@dial.pipex.com> - build, login and many other fixes 7Andre Lucas <andre.lucas@dial.pipex.com> - build, login and many other fixes
8Andy Sloane <andy@guildsoftware.com> - bugfixes 8Andy Sloane <andy@guildsoftware.com> - bugfixes
9Arkadiusz Miskiewicz <misiek@pld.org.pl> - IPv6 compat fixes
9Ben Taylor <bent@clark.net> - Solaris debugging and fixes 10Ben Taylor <bent@clark.net> - Solaris debugging and fixes
10Chip Salzenberg <chip@valinux.com> - Assorted patches 11Chip Salzenberg <chip@valinux.com> - Assorted patches
11Chris Saia <csaia@wtower.com> - SuSE packaging 12Chris Saia <csaia@wtower.com> - SuSE packaging
diff --git a/ChangeLog b/ChangeLog
index a0afccb2c..735444f1c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
120000303 120000303
2 - Added "make host-key" target, Suggestion from Dominik Brettnacher 2 - Added "make host-key" target, Suggestion from Dominik Brettnacher
3 <domi@saargate.de> 3 <domi@saargate.de>
4 - Don't permanently fail on bind() if getaddrinfo has more choices left for
5 us. Needed to work around messy IPv6 on Linux. Patch from Arkadiusz
6 Miskiewicz <misiek@pld.org.pl>
4 7
520000302 820000302
6 - Big cleanup of autoconf code 9 - Big cleanup of autoconf code
diff --git a/channels.c b/channels.c
index ba4c2bef9..7d5e9a1af 100644
--- a/channels.c
+++ b/channels.c
@@ -16,7 +16,7 @@
16 */ 16 */
17 17
18#include "includes.h" 18#include "includes.h"
19RCSID("$Id: channels.c,v 1.16 2000/01/17 02:22:55 damien Exp $"); 19RCSID("$Id: channels.c,v 1.17 2000/03/03 11:35:33 damien Exp $");
20 20
21#include "ssh.h" 21#include "ssh.h"
22#include "packet.h" 22#include "packet.h"
@@ -935,7 +935,11 @@ channel_request_local_forwarding(u_short port, const char *host,
935 /* Bind the socket to the address. */ 935 /* Bind the socket to the address. */
936 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) { 936 if (bind(sock, ai->ai_addr, ai->ai_addrlen) < 0) {
937 /* address can be in use ipv6 address is already bound */ 937 /* address can be in use ipv6 address is already bound */
938 verbose("bind: %.100s", strerror(errno)); 938 if (!ai->ai_next)
939 error("bind: %.100s", strerror(errno));
940 else
941 verbose("bind: %.100s", strerror(errno));
942
939 close(sock); 943 close(sock);
940 continue; 944 continue;
941 } 945 }
@@ -1199,6 +1203,10 @@ x11_create_display_inet(int screen_number, int x11_display_offset)
1199 debug("bind port %d: %.100s", port, strerror(errno)); 1203 debug("bind port %d: %.100s", port, strerror(errno));
1200 shutdown(sock, SHUT_RDWR); 1204 shutdown(sock, SHUT_RDWR);
1201 close(sock); 1205 close(sock);
1206
1207 if (ai->ai_next)
1208 continue;
1209
1202 for (n = 0; n < num_socks; n++) { 1210 for (n = 0; n < num_socks; n++) {
1203 shutdown(socks[n], SHUT_RDWR); 1211 shutdown(socks[n], SHUT_RDWR);
1204 close(socks[n]); 1212 close(socks[n]);
diff --git a/sshd.c b/sshd.c
index f49b45368..0024440ed 100644
--- a/sshd.c
+++ b/sshd.c
@@ -558,7 +558,8 @@ main(int ac, char **av)
558 debug("Bind to port %s on %s.", strport, ntop); 558 debug("Bind to port %s on %s.", strport, ntop);
559 559
560 /* Bind the socket to the desired port. */ 560 /* Bind the socket to the desired port. */
561 if (bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) { 561 if ((bind(listen_sock, ai->ai_addr, ai->ai_addrlen) < 0) &&
562 (!ai->ai_next)) {
562 error("Bind to port %s on %s failed: %.200s.", 563 error("Bind to port %s on %s failed: %.200s.",
563 strport, ntop, strerror(errno)); 564 strport, ntop, strerror(errno));
564 close(listen_sock); 565 close(listen_sock);