From 13785d5c62093540139094f6dfcf808100790939 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 Jan 2008 15:15:01 -0800 Subject: 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) --- source3/smbd/server.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'source3/smbd') 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; } -- cgit