summaryrefslogtreecommitdiff
path: root/channels.c
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 /channels.c
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>
Diffstat (limited to 'channels.c')
-rw-r--r--channels.c12
1 files changed, 10 insertions, 2 deletions
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]);