summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-13 11:41:47 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:52 +0100
commitaa32619c5c910b9f5989f44de21621db5ef7c357 (patch)
tree670cd1bc010718f21ebbf346dcd6dafa9cd25d8a /source4/libcli
parent45d349eb80ebd6b08a8bbcb66f657e89c3480a92 (diff)
downloadsamba-aa32619c5c910b9f5989f44de21621db5ef7c357.tar.gz
samba-aa32619c5c910b9f5989f44de21621db5ef7c357.tar.bz2
samba-aa32619c5c910b9f5989f44de21621db5ef7c357.zip
r26426: Remove uses of global_loadparm.
(This used to be commit e1d177c8c1101965479f7ade2270490cd6fae4f2)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/resolve/nbtlist.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/source4/libcli/resolve/nbtlist.c b/source4/libcli/resolve/nbtlist.c
index 595743e693..21792a665a 100644
--- a/source4/libcli/resolve/nbtlist.c
+++ b/source4/libcli/resolve/nbtlist.c
@@ -38,6 +38,7 @@ struct nbtlist_state {
struct nbt_name_request **queries;
struct nbt_name_query *io_queries;
const char *reply_addr;
+ struct interface *ifaces;
};
/*
@@ -49,7 +50,6 @@ static void nbtlist_handler(struct nbt_name_request *req)
struct composite_context);
struct nbtlist_state *state = talloc_get_type(c->private_data, struct nbtlist_state);
struct nbt_name_query *q;
- struct interface *ifaces;
int i;
for (i=0;i<state->num_queries;i++) {
@@ -76,16 +76,14 @@ static void nbtlist_handler(struct nbt_name_request *req)
}
/* favor a local address if possible */
- load_interfaces(NULL, lp_interfaces(global_loadparm), &ifaces);
state->reply_addr = NULL;
for (i=0;i<q->out.num_addrs;i++) {
- if (iface_is_local(ifaces, q->out.reply_addrs[i])) {
+ if (iface_is_local(state->ifaces, q->out.reply_addrs[i])) {
state->reply_addr = talloc_steal(state,
q->out.reply_addrs[i]);
break;
}
}
- talloc_free(ifaces);
if (state->reply_addr == NULL) {
state->reply_addr = talloc_steal(state,
@@ -129,6 +127,8 @@ struct composite_context *resolve_name_nbtlist_send(TALLOC_CTX *mem_ctx,
if (composite_nomem(state->name.scope, c)) return c;
}
+ load_interfaces(state, lp_interfaces(global_loadparm), &state->ifaces);
+
/*
* we can't push long names on the wire,
* so bail out here to give a useful error message
@@ -200,7 +200,8 @@ NTSTATUS resolve_name_nbtlist(struct nbt_name *name,
bool broadcast, bool wins_lookup,
const char **reply_addr)
{
- struct composite_context *c = resolve_name_nbtlist_send(mem_ctx, NULL, name, address_list,
+ struct composite_context *c = resolve_name_nbtlist_send(mem_ctx, NULL,
+ name, address_list,
broadcast, wins_lookup);
return resolve_name_nbtlist_recv(c, mem_ctx, reply_addr);
}