[PATCH] Linux socket-specific keepalive settings

Ed Boraas ed.boraas at concordia.ab.ca
Fri Apr 29 16:52:34 GMT 2005


Hi,

Below (and attached) is a simple patch that we've found useful at our
site. It simply enables the setting of the three per-socket keepalive
options (available in Linux 2.4 and above) on systems that support them.

These three socket options would also need to be added to the list of
available options in the "socket options" section of smb.conf.5.

-Ed


--- ./samba-3.0.14a/source/lib/util_sock.c      2005-02-25
10:59:32.000000000 -0700
+++ ./samba-3.0.14a.local/source/lib/util_sock.c        2005-04-29
09:23:12.000000000 -0600
@@ -98,6 +98,15 @@
 #ifdef TCP_NODELAY
   {"TCP_NODELAY",       IPPROTO_TCP,   TCP_NODELAY,     0,
OPT_BOOL},
 #endif
+#ifdef TCP_KEEPCNT
+  {"TCP_KEEPCNT",       IPPROTO_TCP,   TCP_KEEPCNT,     0,
OPT_INT},
+#endif
+#ifdef TCP_KEEPIDLE
+  {"TCP_KEEPIDLE",      IPPROTO_TCP,   TCP_KEEPIDLE,    0,
OPT_INT},
+#endif
+#ifdef TCP_KEEPINTVL
+  {"TCP_KEEPINTVL",     IPPROTO_TCP,   TCP_KEEPINTVL,   0,
OPT_INT},
+#endif
 #ifdef IPTOS_LOWDELAY
   {"IPTOS_LOWDELAY",    IPPROTO_IP,    IP_TOS,          IPTOS_LOWDELAY,
OPT_ON},
 #endif
-------------- next part --------------
A non-text attachment was scrubbed...
Name: linux-persocket-keepalives.diff
Type: application/octet-stream
Size: 789 bytes
Desc: linux-persocket-keepalives.diff
Url : http://lists.samba.org/archive/samba-technical/attachments/20050429/6f34fd4c/linux-persocket-keepalives.obj


More information about the samba-technical mailing list