]> andersk Git - openssh.git/commitdiff
- djm@cvs.openbsd.org 2005/04/06 09:43:59
authordjm <djm>
Thu, 26 May 2005 01:59:32 +0000 (01:59 +0000)
committerdjm <djm>
Thu, 26 May 2005 01:59:32 +0000 (01:59 +0000)
     [sshd.c]
     avoid harmless logspam by not performing setsockopt() on non-socket;
     ok markus@

ChangeLog
sshd.c

index d72e4483430070e2a9b48c7c379c4dcc3a00f3de..00d826ea73b6435e5b347ecff88574e427c7e521 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@
  - (djm) OpenBSD CVS Sync
    - otto@cvs.openbsd.org 2005/04/05 13:45:31
      [ssh-keygen.c]
+   - djm@cvs.openbsd.org 2005/04/06 09:43:59
+     [sshd.c]
+     avoid harmless logspam by not performing setsockopt() on non-socket;
+     ok markus@
 
 20050524
  - (djm) [contrib/caldera/openssh.spec contrib/redhat/openssh.spec]
diff --git a/sshd.c b/sshd.c
index b3fcc6964e201a3a3bad7ab1bfdb978aa6ba5dd9..7ee2dd68666753532e870d4b4822f4db89ec354e 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -42,7 +42,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: sshd.c,v 1.308 2005/02/08 22:24:57 dtucker Exp $");
+RCSID("$OpenBSD: sshd.c,v 1.309 2005/04/06 09:43:59 djm Exp $");
 
 #include <openssl/dh.h>
 #include <openssl/bn.h>
@@ -1615,18 +1615,17 @@ main(int ac, char **av)
        signal(SIGCHLD, SIG_DFL);
        signal(SIGINT, SIG_DFL);
 
-       /* Set SO_KEEPALIVE if requested. */
-       if (options.tcp_keep_alive &&
-           setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on,
-           sizeof(on)) < 0)
-               error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));
-
        /*
         * Register our connection.  This turns encryption off because we do
         * not have a key.
         */
        packet_set_connection(sock_in, sock_out);
 
+       /* Set SO_KEEPALIVE if requested. */
+       if (options.tcp_keep_alive && packet_connection_is_on_socket() &&
+           setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)) < 0)
+               error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno));
+
        remote_port = get_remote_port();
        remote_ip = get_remote_ipaddr();
 
This page took 0.071172 seconds and 5 git commands to generate.