diff options
author | Damien Miller <djm@mindrot.org> | 2000-03-03 22:35:33 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2000-03-03 22:35:33 +1100 |
commit | 3c7eeb2af5e97c074ea1ba29f1ebe7a2d710ea48 (patch) | |
tree | 69d1e7af0853de884c742c0be1c37aa0fa02f13f /sshd.c | |
parent | 4095f894dce73a9024493c81190f786b64672c4a (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 'sshd.c')
-rw-r--r-- | sshd.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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); |