diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2004-02-23 12:02:34 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2004-02-23 12:02:34 +0000 |
commit | 05369c21f24e30614be163084ab0852f26bf8e4e (patch) | |
tree | 98e823e3206180f8518e38d8aa0947645149b5b4 | |
parent | d1155eb9de312f5c7764006455b3cf3dd223cc09 (diff) |
backout revision 1.279; set listen socket to non-block; ok henning.
-rw-r--r-- | usr.bin/ssh/sshd.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.bin/ssh/sshd.c b/usr.bin/ssh/sshd.c index 7dfb4472add..fce72a156d4 100644 --- a/usr.bin/ssh/sshd.c +++ b/usr.bin/ssh/sshd.c @@ -42,7 +42,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshd.c,v 1.285 2004/02/05 05:37:17 dtucker Exp $"); +RCSID("$OpenBSD: sshd.c,v 1.286 2004/02/23 12:02:33 markus Exp $"); #include <openssl/dh.h> #include <openssl/bn.h> @@ -1087,6 +1087,11 @@ main(int ac, char **av) verbose("socket: %.100s", strerror(errno)); continue; } + if (fcntl(listen_sock, F_SETFL, O_NONBLOCK) < 0) { + error("listen_sock O_NONBLOCK: %s", strerror(errno)); + close(listen_sock); + continue; + } /* * Set socket options. * Allow local port reuse in TIME_WAIT. @@ -1225,6 +1230,11 @@ main(int ac, char **av) error("accept: %.100s", strerror(errno)); continue; } + if (fcntl(newsock, F_SETFL, 0) < 0) { + error("newsock del O_NONBLOCK: %s", strerror(errno)); + close(newsock); + continue; + } if (drop_connection(startups) == 1) { debug("drop connection #%d", startups); close(newsock); |