summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/sshd.c b/sshd.c
index 55c57e195..17f001669 100644
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
42 */ 42 */
43 43
44#include "includes.h" 44#include "includes.h"
45RCSID("$OpenBSD: sshd.c,v 1.257 2002/07/23 16:03:10 stevesk Exp $"); 45RCSID("$OpenBSD: sshd.c,v 1.258 2002/09/13 19:23:09 stevesk Exp $");
46 46
47#include <openssl/dh.h> 47#include <openssl/dh.h>
48#include <openssl/bn.h> 48#include <openssl/bn.h>
@@ -806,7 +806,6 @@ main(int ac, char **av)
806 const char *remote_ip; 806 const char *remote_ip;
807 int remote_port; 807 int remote_port;
808 FILE *f; 808 FILE *f;
809 struct linger linger;
810 struct addrinfo *ai; 809 struct addrinfo *ai;
811 char ntop[NI_MAXHOST], strport[NI_MAXSERV]; 810 char ntop[NI_MAXHOST], strport[NI_MAXSERV];
812 int listen_sock, maxfd; 811 int listen_sock, maxfd;
@@ -1152,17 +1151,12 @@ main(int ac, char **av)
1152 continue; 1151 continue;
1153 } 1152 }
1154 /* 1153 /*
1155 * Set socket options. We try to make the port 1154 * Set socket options.
1156 * reusable and have it close as fast as possible 1155 * Allow local port reuse in TIME_WAIT.
1157 * without waiting in unnecessary wait states on
1158 * close.
1159 */ 1156 */
1160 setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, 1157 if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR,
1161 &on, sizeof(on)); 1158 &on, sizeof(on)) == -1)
1162 linger.l_onoff = 1; 1159 error("setsockopt SO_REUSEADDR: %s", strerror(errno));
1163 linger.l_linger = 5;
1164 setsockopt(listen_sock, SOL_SOCKET, SO_LINGER,
1165 &linger, sizeof(linger));
1166 1160
1167 debug("Bind to port %s on %s.", strport, ntop); 1161 debug("Bind to port %s on %s.", strport, ntop);
1168 1162
@@ -1411,16 +1405,6 @@ main(int ac, char **av)
1411 signal(SIGCHLD, SIG_DFL); 1405 signal(SIGCHLD, SIG_DFL);
1412 signal(SIGINT, SIG_DFL); 1406 signal(SIGINT, SIG_DFL);
1413 1407
1414 /*
1415 * Set socket options for the connection. We want the socket to
1416 * close as fast as possible without waiting for anything. If the
1417 * connection is not a socket, these will do nothing.
1418 */
1419 /* setsockopt(sock_in, SOL_SOCKET, SO_REUSEADDR, (void *)&on, sizeof(on)); */
1420 linger.l_onoff = 1;
1421 linger.l_linger = 5;
1422 setsockopt(sock_in, SOL_SOCKET, SO_LINGER, &linger, sizeof(linger));
1423
1424 /* Set keepalives if requested. */ 1408 /* Set keepalives if requested. */
1425 if (options.keepalives && 1409 if (options.keepalives &&
1426 setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on, 1410 setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,