diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-05-12 12:37:34 +0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2011-06-06 12:26:10 +1000 |
commit | 1812dca0aeb399254e652f91c00c31d9dd58a367 (patch) | |
tree | 78dd4aeb6eed969d68755516dc77d452626a3785 | |
parent | 8f3ce14ea744d721636d3e096ae1f021aae042bd (diff) | |
download | samba-1812dca0aeb399254e652f91c00c31d9dd58a367.tar.gz samba-1812dca0aeb399254e652f91c00c31d9dd58a367.tar.bz2 samba-1812dca0aeb399254e652f91c00c31d9dd58a367.zip |
s4-ipv6: only listen on V4 addresses in the NBT server
NBT doesn't do IPv6
-rw-r--r-- | source4/nbt_server/interfaces.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/source4/nbt_server/interfaces.c b/source4/nbt_server/interfaces.c index 4bb8a0852c..ccbc89accf 100644 --- a/source4/nbt_server/interfaces.c +++ b/source4/nbt_server/interfaces.c @@ -286,15 +286,16 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con if (!lpcfg_bind_interfaces_only(lp_ctx)) { const char *primary_address; + primary_address = iface_list_first_v4(ifaces); + /* the primary address is the address we will return for non-WINS queries not made on a specific interface */ - if (num_interfaces > 0) { - primary_address = iface_list_n_ip(ifaces, 0); - } else { + if (primary_address == NULL) { primary_address = inet_ntoa(interpret_addr2( - lpcfg_netbios_name(lp_ctx))); + lpcfg_netbios_name(lp_ctx))); } + primary_address = talloc_strdup(tmp_ctx, primary_address); NT_STATUS_HAVE_NO_MEMORY(primary_address); @@ -308,9 +309,15 @@ NTSTATUS nbtd_startup_interfaces(struct nbtd_server *nbtsrv, struct loadparm_con } for (i=0; i<num_interfaces; i++) { - const char *bcast = iface_list_n_bcast(ifaces, i); + const char *bcast; const char *address, *netmask; + if (!iface_list_n_is_v4(ifaces, i)) { + /* v4 only for NBT protocol */ + continue; + } + + bcast = iface_list_n_bcast(ifaces, i); /* we can't assume every interface is broadcast capable */ if (bcast == NULL) continue; |