summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/sshd.c b/sshd.c
index b3fcc6964..7ee2dd686 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.308 2005/02/08 22:24:57 dtucker Exp $"); 45RCSID("$OpenBSD: sshd.c,v 1.309 2005/04/06 09:43:59 djm Exp $");
46 46
47#include <openssl/dh.h> 47#include <openssl/dh.h>
48#include <openssl/bn.h> 48#include <openssl/bn.h>
@@ -1615,18 +1615,17 @@ main(int ac, char **av)
1615 signal(SIGCHLD, SIG_DFL); 1615 signal(SIGCHLD, SIG_DFL);
1616 signal(SIGINT, SIG_DFL); 1616 signal(SIGINT, SIG_DFL);
1617 1617
1618 /* Set SO_KEEPALIVE if requested. */
1619 if (options.tcp_keep_alive &&
1620 setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,
1621 sizeof(on)) < 0)
1622 error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));
1623
1624 /* 1618 /*
1625 * Register our connection. This turns encryption off because we do 1619 * Register our connection. This turns encryption off because we do
1626 * not have a key. 1620 * not have a key.
1627 */ 1621 */
1628 packet_set_connection(sock_in, sock_out); 1622 packet_set_connection(sock_in, sock_out);
1629 1623
1624 /* Set SO_KEEPALIVE if requested. */
1625 if (options.tcp_keep_alive && packet_connection_is_on_socket() &&
1626 setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)) < 0)
1627 error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));
1628
1630 remote_port = get_remote_port(); 1629 remote_port = get_remote_port();
1631 remote_ip = get_remote_ipaddr(); 1630 remote_ip = get_remote_ipaddr();
1632 1631