summaryrefslogtreecommitdiff
path: root/source4/libcli/resolve
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-02-15 04:18:11 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:51:56 -0500
commit048704a7e54573086e7913519d2b72577a34b135 (patch)
treeb2267d9f1c79163c5496da5e2e0028a11fde7cd5 /source4/libcli/resolve
parent8c7a593bcd5a30e47d1f062bfb9ca7d5118fe459 (diff)
downloadsamba-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/libcli/resolve')
-rw-r--r--source4/libcli/resolve/bcast.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c
index c95fe945b1..f8ea6b2b3b 100644
--- a/source4/libcli/resolve/bcast.c
+++ b/source4/libcli/resolve/bcast.c
@@ -31,19 +31,22 @@ struct composite_context *resolve_name_bcast_send(struct nbt_name *name,
int num_interfaces = iface_count();
const char **address_list;
struct composite_context *c;
- int i;
+ int i, count=0;
address_list = talloc_array(NULL, const char *, num_interfaces+1);
if (address_list == NULL) return NULL;
for (i=0;i<num_interfaces;i++) {
- address_list[i] = talloc_strdup(address_list, iface_n_bcast(i));
- if (address_list[i] == NULL) {
+ const char *bcast = iface_n_bcast(i);
+ if (bcast == NULL) continue;
+ address_list[count] = talloc_strdup(address_list, bcast);
+ if (address_list[count] == NULL) {
talloc_free(address_list);
return NULL;
}
+ count++;
}
- address_list[i] = NULL;
+ address_list[count] = NULL;
c = resolve_name_nbtlist_send(name, event_ctx, address_list, True, False);
talloc_free(address_list);