summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c3
1 files changed, 2 insertions, 1 deletions
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);