summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-02-02 10:35:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:28 -0500
commit906ca09578297d06eb839661535c2ed3e2e1b35a (patch)
tree0364e84a7f8641e36155ad1bdcf2ad229c2c6ec2
parent77cdd7c0ff182f77b1edb032f8d8cd172bdff7ce (diff)
downloadsamba-906ca09578297d06eb839661535c2ed3e2e1b35a.tar.gz
samba-906ca09578297d06eb839661535c2ed3e2e1b35a.tar.bz2
samba-906ca09578297d06eb839661535c2ed3e2e1b35a.zip
r5172: actually bind to the right address for the wildcard interface ....
(This used to be commit 7720d247fed3343a5bf39b2eedf34604f9203a37)
-rw-r--r--source4/nbt_server/interfaces.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c
index 8c5566c819..be1773e91e 100644
--- a/source4/nbt_server/interfaces.c
+++ b/source4/nbt_server/interfaces.c
@@ -63,6 +63,7 @@ struct nbt_iface_name *nbt_find_iname(struct nbt_interface *iface, struct nbt_na
start listening on the given address
*/
static NTSTATUS nbt_add_socket(struct nbt_server *nbtsrv,
+ const char *bind_address,
const char *address,
const char *bcast,
const char *netmask)
@@ -106,7 +107,7 @@ static NTSTATUS nbt_add_socket(struct nbt_server *nbtsrv,
iface->nbtsock = nbt_name_socket_init(iface, nbtsrv->task->event_ctx);
NT_STATUS_HAVE_NO_MEMORY(iface->ip_address);
- status = socket_listen(iface->nbtsock->sock, address, lp_nbt_port(), 0, 0);
+ status = socket_listen(iface->nbtsock->sock, bind_address, lp_nbt_port(), 0, 0);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to bind to %s:%d - %s\n",
address, lp_nbt_port(), nt_errstr(status)));
@@ -157,6 +158,7 @@ NTSTATUS nbt_startup_interfaces(struct nbt_server *nbtsrv)
NT_STATUS_HAVE_NO_MEMORY(primary_address);
status = nbt_add_socket(nbtsrv,
+ "0.0.0.0",
primary_address,
talloc_strdup(tmp_ctx, "255.255.255.255"),
talloc_strdup(tmp_ctx, "0.0.0.0"));
@@ -168,7 +170,7 @@ NTSTATUS nbt_startup_interfaces(struct nbt_server *nbtsrv)
const char *bcast = talloc_strdup(tmp_ctx, sys_inet_ntoa(*iface_n_bcast(i)));
const char *netmask = talloc_strdup(tmp_ctx, sys_inet_ntoa(*iface_n_netmask(i)));
- status = nbt_add_socket(nbtsrv, address, bcast, netmask);
+ status = nbt_add_socket(nbtsrv, address, address, bcast, netmask);
NT_STATUS_NOT_OK_RETURN(status);
}