summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-01-10 15:15:01 -0800
committerJeremy Allison <jra@samba.org>2008-01-10 15:15:01 -0800
commit13785d5c62093540139094f6dfcf808100790939 (patch)
treefa130d2ef7cdbea024709e538abbb518d9fd1593
parente17642e849b28c323ba6bd7cc212455d727901db (diff)
downloadsamba-13785d5c62093540139094f6dfcf808100790939.tar.gz
samba-13785d5c62093540139094f6dfcf808100790939.tar.bz2
samba-13785d5c62093540139094f6dfcf808100790939.zip
Don't print out debug messages at level 0 if we can't
bind to a socket if we've already bound to one (this prevents : bind failed on port 445 socket_addr = 0.0.0.0. Error = Address already in use bind failed on port 139 socket_addr = 0.0.0.0. Error = Address already in use messages when trying to bind to an IPv4 address when we've already bound to the IPv6 equivalent. Jeremy. (This used to be commit 3936de735a7bb548df8ce7f06f2cc8f7ffdf56cd)
-rw-r--r--source3/smbd/server.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source3/smbd/server.c b/source3/smbd/server.c
index 43a6d62a28..8371d17f10 100644
--- a/source3/smbd/server.c
+++ b/source3/smbd/server.c
@@ -390,8 +390,11 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
}
s = fd_listenset[num_sockets] =
- open_socket_in(SOCK_STREAM, port, 0,
- ifss, True);
+ open_socket_in(SOCK_STREAM,
+ port,
+ num_sockets == 0 ? 0 : 2,
+ ifss,
+ true);
if(s == -1) {
continue;
}
@@ -467,8 +470,11 @@ static bool open_sockets_smbd(bool is_daemon, bool interactive, const char *smb_
continue;
}
- s = open_socket_in(SOCK_STREAM, port, 0,
- &ss, true);
+ s = open_socket_in(SOCK_STREAM,
+ port,
+ num_sockets == 0 ? 0 : 2,
+ &ss,
+ true);
if (s == -1) {
continue;
}