diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-02-15 04:18:11 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:51:56 -0500 |
commit | 048704a7e54573086e7913519d2b72577a34b135 (patch) | |
tree | b2267d9f1c79163c5496da5e2e0028a11fde7cd5 /source4/nbt_server | |
parent | 8c7a593bcd5a30e47d1f062bfb9ca7d5118fe459 (diff) | |
download | samba-048704a7e54573086e7913519d2b72577a34b135.tar.gz samba-048704a7e54573086e7913519d2b72577a34b135.tar.bz2 samba-048704a7e54573086e7913519d2b72577a34b135.zip |
r13505: allow servers to bind to non-broadcast interfaces. Servers now
specifically ask for iface_n_bcast() and have to check if it returns
NULL, in which case it is a non-broadcast interface
(This used to be commit d004e250b6710251ea089ac242775481f13b5c2b)
Diffstat (limited to 'source4/nbt_server')
-rw-r--r-- | source4/nbt_server/interfaces.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 9fdad96b55..36a65b1859 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -245,9 +245,15 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv) } for (i=0; i<num_interfaces; i++) { - const char *address = talloc_strdup(tmp_ctx, iface_n_ip(i)); - const char *bcast = talloc_strdup(tmp_ctx, iface_n_bcast(i)); - const char *netmask = talloc_strdup(tmp_ctx, iface_n_netmask(i)); + const char *bcast = iface_n_bcast(i); + const char *address, *netmask; + + /* we can't assume every interface is broadcast capable */ + if (bcast == NULL) continue; + + address = talloc_strdup(tmp_ctx, iface_n_ip(i)); + bcast = talloc_strdup(tmp_ctx, bcast); + netmask = talloc_strdup(tmp_ctx, iface_n_netmask(i)); status = nbtd_add_socket(nbtsrv, address, address, bcast, netmask); NT_STATUS_NOT_OK_RETURN(status); |