diff options
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); |