summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2001-08-09 12:52:05 +0000
committerAndrew Bartlett <abartlet@samba.org>2001-08-09 12:52:05 +0000
commit23b6772a2454ff3b480807a4ca8f58e8a0dc0c81 (patch)
treefaa4507018058c74dbeb38983f87ec9fcacfaa42
parent2c73ae4ac7ad56730ef22a1b5f6ca3351cf7036e (diff)
downloadsamba-23b6772a2454ff3b480807a4ca8f58e8a0dc0c81.tar.gz
samba-23b6772a2454ff3b480807a4ca8f58e8a0dc0c81.tar.xz
samba-23b6772a2454ff3b480807a4ca8f58e8a0dc0c81.zip
Try to set the socket options early for some OSs (like Sol 8) where they
can't be set after the listen(). Andrew Bartlett
-rw-r--r--source/smbd/server.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/source/smbd/server.c b/source/smbd/server.c
index 6e9b9a48284..13071a5b65b 100644
--- a/source/smbd/server.c
+++ b/source/smbd/server.c
@@ -158,7 +158,11 @@ max can be %d\n",
s = fd_listenset[i] = open_socket_in(SOCK_STREAM, port, 0, ifip->s_addr, True);
if(s == -1)
return False;
- /* ready to listen */
+
+ /* ready to listen */
+ set_socket_options(s,"SO_KEEPALIVE");
+ set_socket_options(s,user_socket_options);
+
if (listen(s, 5) == -1) {
DEBUG(0,("listen: %s\n",strerror(errno)));
close(s);
@@ -178,6 +182,9 @@ max can be %d\n",
return(False);
/* ready to listen */
+ set_socket_options(s,"SO_KEEPALIVE");
+ set_socket_options(s,user_socket_options);
+
if (listen(s, 5) == -1) {
DEBUG(0,("open_sockets: listen: %s\n",
strerror(errno)));