diff options
Diffstat (limited to 'source4/torture/nbt/winsreplication.c')
-rw-r--r-- | source4/torture/nbt/winsreplication.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/source4/torture/nbt/winsreplication.c b/source4/torture/nbt/winsreplication.c index b427843b80..d96ed3e931 100644 --- a/source4/torture/nbt/winsreplication.c +++ b/source4/torture/nbt/winsreplication.c @@ -107,10 +107,10 @@ static bool test_assoc_ctx1(struct torture_context *tctx) wrepl_socket2 = wrepl_socket_init(tctx, NULL); torture_comment(tctx, "Setup 2 wrepl connections\n"); - status = wrepl_connect(wrepl_socket1, NULL, address); + status = wrepl_connect(wrepl_socket1, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); - status = wrepl_connect(wrepl_socket2, NULL, address); + status = wrepl_connect(wrepl_socket2, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send a start association request (conn1)\n"); @@ -189,7 +189,7 @@ static bool test_assoc_ctx2(struct torture_context *tctx) wrepl_socket = wrepl_socket_init(tctx, NULL); torture_comment(tctx, "Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, NULL, address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send 1st start association request\n"); @@ -258,7 +258,7 @@ static bool test_wins_replication(struct torture_context *tctx) wrepl_socket = wrepl_socket_init(tctx, NULL); torture_comment(tctx, "Setup wrepl connections\n"); - status = wrepl_connect(wrepl_socket, NULL, address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, address); CHECK_STATUS(tctx, status, NT_STATUS_OK); torture_comment(tctx, "Send a start association request\n"); @@ -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; @@ -556,7 +557,7 @@ static struct test_wrepl_conflict_conn *test_create_conflict_ctx( if (!ctx->pull) return NULL; torture_comment(tctx, "Setup wrepl conflict pull connection\n"); - status = wrepl_connect(ctx->pull, NULL, ctx->address); + status = wrepl_connect(ctx->pull, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address); if (!NT_STATUS_IS_OK(status)) return NULL; status = wrepl_associate(ctx->pull, &associate); @@ -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(tctx, 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; } @@ -721,7 +724,7 @@ static bool test_wrepl_update_one(struct torture_context *tctx, wrepl_socket = wrepl_socket_init(ctx, NULL); - status = wrepl_connect(wrepl_socket, NULL, ctx->address); + status = wrepl_connect(wrepl_socket, lp_resolve_context(tctx->lp_ctx), NULL, ctx->address); CHECK_STATUS(tctx, status, NT_STATUS_OK); status = wrepl_associate(wrepl_socket, &associate); @@ -6530,6 +6533,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx */ name_register->in.name = records[i].name; name_register->in.dest_addr = ctx->address; + name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx); name_register->in.address = records[i].wins.ips[0].ip; name_register->in.nb_flags = records[i].wins.nb_flags; name_register->in.register_demand= false; @@ -6558,6 +6562,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx /* release the record */ release->in.name = records[i].name; + release->in.dest_port = lp_nbt_port(tctx->lp_ctx); release->in.dest_addr = ctx->address; release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; @@ -6612,6 +6617,7 @@ static bool test_conflict_owned_released_vs_replica(struct torture_context *tctx } else { release->in.name = records[i].name; release->in.dest_addr = ctx->address; + release->in.dest_port = lp_nbt_port(tctx->lp_ctx); release->in.address = records[i].wins.ips[0].ip; release->in.nb_flags = records[i].wins.nb_flags; release->in.broadcast = false; @@ -9218,6 +9224,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, name_register->in.name = records[i].name; name_register->in.dest_addr = ctx->address; + name_register->in.dest_port = lp_nbt_port(tctx->lp_ctx); name_register->in.address = records[i].wins.ips[j].ip; name_register->in.nb_flags = records[i].wins.nb_flags; name_register->in.register_demand= false; @@ -9363,6 +9370,7 @@ static bool test_conflict_owned_active_vs_replica(struct torture_context *tctx, release->in.name = records[i].name; release->in.dest_addr = ctx->address; + release->in.dest_port = lp_nbt_port(tctx->lp_ctx); release->in.address = records[i].wins.ips[j].ip; release->in.nb_flags = records[i].wins.nb_flags; release->in.broadcast = false; |