From 6f2252dace1629d7b5c5637b103caa28d2c89b07 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 11 Dec 2007 22:23:14 +0100 Subject: r26401: Don't cache interfaces context in libnetif. (This used to be commit 9f975417cc66bfd4589da38bfd23731dbe0e6153) --- source4/libcli/resolve/bcast.c | 15 ++++++++++----- source4/libcli/resolve/nbtlist.c | 4 +++- source4/libcli/resolve/resolve.h | 1 + 3 files changed, 14 insertions(+), 6 deletions(-) (limited to 'source4/libcli/resolve') diff --git a/source4/libcli/resolve/bcast.c b/source4/libcli/resolve/bcast.c index 1733ca9d2e..d1f3d65faf 100644 --- a/source4/libcli/resolve/bcast.c +++ b/source4/libcli/resolve/bcast.c @@ -33,17 +33,19 @@ struct composite_context *resolve_name_bcast_send(TALLOC_CTX *mem_ctx, void *userdata, struct nbt_name *name) { - struct loadparm_context *lp_ctx = userdata; - int num_interfaces = iface_count(lp_ctx); + int num_interfaces; const char **address_list; struct composite_context *c; int i, count=0; + struct interface *ifaces = userdata; + + num_interfaces = iface_count(ifaces); address_list = talloc_array(mem_ctx, const char *, num_interfaces+1); if (address_list == NULL) return NULL; for (i=0;iprivate_data, struct nbtlist_state); struct nbt_name_query *q; + struct interface *ifaces; int i; for (i=0;inum_queries;i++) { @@ -75,9 +76,10 @@ static void nbtlist_handler(struct nbt_name_request *req) } /* favor a local address if possible */ + load_interfaces(lp_interfaces(global_loadparm), &ifaces); state->reply_addr = NULL; for (i=0;iout.num_addrs;i++) { - if (iface_is_local(global_loadparm, q->out.reply_addrs[i])) { + if (iface_is_local(ifaces, q->out.reply_addrs[i])) { state->reply_addr = talloc_steal(state, q->out.reply_addrs[i]); break; diff --git a/source4/libcli/resolve/resolve.h b/source4/libcli/resolve/resolve.h index 9282074aa4..79b91dc836 100644 --- a/source4/libcli/resolve/resolve.h +++ b/source4/libcli/resolve/resolve.h @@ -26,6 +26,7 @@ typedef struct composite_context *(*resolve_name_send_fn)(TALLOC_CTX *mem_ctx, struct event_context *, void *privdata, struct nbt_name *); typedef NTSTATUS (*resolve_name_recv_fn)(struct composite_context *, TALLOC_CTX *, const char **); #include "libcli/resolve/proto.h" +struct interface; #include "libcli/resolve/lp_proto.h" #endif /* __RESOLVE_H__ */ -- cgit