summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sup/lib
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1996-09-06 16:08:32 +0000
committerpeter <peter@FreeBSD.org>1996-09-06 16:08:32 +0000
commit39220f3d9a3cfb8ce818fe3ccac085cf41f53546 (patch)
tree70522a1f6db0a1132c56f92c25f044ac65b6e0b5 /usr.sbin/sup/lib
parent2e4724385471f218b6ea0f22573efcfce69e4006 (diff)
downloadFreeBSD-src-39220f3d9a3cfb8ce818fe3ccac085cf41f53546.zip
FreeBSD-src-39220f3d9a3cfb8ce818fe3ccac085cf41f53546.tar.gz
Turn on SO_KEEPALIVE on network connections. Since we limit the number
of connections, we cannot afford to allow "disappeared" client to cause us to leave one of the 14 connections open and hanging in a read() forever. (SO_KEEPALIVE causes probe packets to be sent after a few hours of IDLE time where no data has been transferred. Sup should NEVER do this, so the only time it will have an effect is if it looses the remote machine)
Diffstat (limited to 'usr.sbin/sup/lib')
-rw-r--r--usr.sbin/sup/lib/scm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/usr.sbin/sup/lib/scm.c b/usr.sbin/sup/lib/scm.c
index 9b793e2..bbfe943 100644
--- a/usr.sbin/sup/lib/scm.c
+++ b/usr.sbin/sup/lib/scm.c
@@ -69,6 +69,9 @@
* since Tahoe version of <netinet/in.h> does not define them.
*
* $Log: scm.c,v $
+ * Revision 1.2 1995/12/26 05:02:49 peter
+ * Apply ports/net/sup/patches/patch-aa...
+ *
* Revision 1.1.1.1 1995/12/26 04:54:47 peter
* Import the unmodified version of the sup that we are using.
* The heritage of this version is not clear. It appears to be NetBSD
@@ -268,6 +271,8 @@ char *server;
return (scmerr (errno, stderr, "Can't create socket for connections"));
if (setsockopt (sock,SOL_SOCKET,SO_REUSEADDR,(char *)&one,sizeof(int)) < 0)
(void) scmerr (errno, stderr, "Can't set SO_REUSEADDR socket option");
+ if (setsockopt (sock,SOL_SOCKET,SO_KEEPALIVE,(char *)&one,sizeof(int)) < 0)
+ (void) scmerr (errno, stderr, "Can't set SO_KEEPALIVE socket option");
(void) bzero ((char *)&sin,sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = port;
OpenPOWER on IntegriCloud