summaryrefslogtreecommitdiff
path: root/source4/torture/nbt/winsreplication.c
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-11 22:23:14 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:32 +0100
commit6f2252dace1629d7b5c5637b103caa28d2c89b07 (patch)
treefc09abaf04401ef510d55866066738840d052ebf /source4/torture/nbt/winsreplication.c
parentf9948d18d73fb8d8711c3b5a46b1d83c881a0084 (diff)
downloadsamba-6f2252dace1629d7b5c5637b103caa28d2c89b07.tar.gz
samba-6f2252dace1629d7b5c5637b103caa28d2c89b07.tar.bz2
samba-6f2252dace1629d7b5c5637b103caa28d2c89b07.zip
r26401: Don't cache interfaces context in libnetif.
(This used to be commit 9f975417cc66bfd4589da38bfd23731dbe0e6153)
Diffstat (limited to 'source4/torture/nbt/winsreplication.c')
-rw-r--r--source4/torture/nbt/winsreplication.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c
index fc88d7fce1..b90daa98c4 100644
--- a/source4/torture/nbt/winsreplication.c
+++ b/source4/torture/nbt/winsreplication.c
@@ -547,6 +547,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
struct socket_address *nbt_srv_addr;
NTSTATUS status;
uint32_t i;
+ struct interface *ifaces;
ctx = talloc_zero(tctx, struct test_wrepl_conflict_conn);
if (!ctx) return NULL;
@@ -612,12 +613,14 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
ctx->nbtsock = nbt_name_socket_init(ctx, NULL);
if (!ctx->nbtsock) return NULL;
- ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(tctx->lp_ctx, address), 0);
+ load_interfaces(lp_interfaces(tctx->lp_ctx), &ifaces);
+
+ ctx->myaddr = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_best_ip(ifaces, address), 0);
if (!ctx->myaddr) return NULL;
- for (i = 0; i < iface_count(tctx->lp_ctx); i++) {
- if (strcmp(ctx->myaddr->addr, iface_n_ip(tctx->lp_ctx, i)) == 0) continue;
- ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(tctx->lp_ctx, i), 0);
+ for (i = 0; i < iface_count(ifaces); i++) {
+ if (strcmp(ctx->myaddr->addr, iface_n_ip(ifaces, i)) == 0) continue;
+ ctx->myaddr2 = socket_address_from_strings(tctx, ctx->nbtsock->sock->backend_name, iface_n_ip(ifaces, i), 0);
if (!ctx->myaddr2) return NULL;
break;
}
@@ -674,12 +677,12 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx(
ctx->addresses_best[0].owner = ctx->b.address;
ctx->addresses_best[0].ip = ctx->myaddr->addr;
- ctx->addresses_all_num = iface_count(tctx->lp_ctx);
+ ctx->addresses_all_num = iface_count(ifaces);
ctx->addresses_all = talloc_array(ctx, struct wrepl_ip, ctx->addresses_all_num);
if (!ctx->addresses_all) return NULL;
for (i=0; i < ctx->addresses_all_num; i++) {
ctx->addresses_all[i].owner = ctx->b.address;
- ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(tctx->lp_ctx, i));
+ ctx->addresses_all[i].ip = talloc_strdup(ctx->addresses_all, iface_n_ip(ifaces, i));
if (!ctx->addresses_all[i].ip) return NULL;
}