summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 08d160cb..234bc117 100644
--- 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
diff --git a/ChangeLog b/ChangeLog
index a0afccb2..735444f1 100644
--- 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
diff --git a/channels.c b/channels.c
index ba4c2bef..7d5e9a1a 100644
--- a/channels.c
+++ b/channels.c
@@ -16,7 +16,7 @@
*/
#include "includes.h"
-RCSID("$Id: channels.c,v 1.16 2000/01/17 02:22:55 damien Exp $");
+RCSID("$Id: channels.c,v 1.17 2000/03/03 11:35:33 damien Exp $");
#include "ssh.h"
#include "packet.h"
@@ -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 f49b4536..0024440e 100644
--- 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);