diff options
Diffstat (limited to 'source4/torture/nbt/dgram.c')
-rw-r--r-- | source4/torture/nbt/dgram.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/source4/torture/nbt/dgram.c b/source4/torture/nbt/dgram.c index bc3aa5dd57..0315989d66 100644 --- a/source4/torture/nbt/dgram.c +++ b/source4/torture/nbt/dgram.c @@ -77,6 +77,8 @@ static bool nbt_test_netlogon(struct torture_context *tctx) const char *address; struct nbt_name name; + + struct interface *ifaces; name.name = lp_workgroup(tctx->lp_ctx); name.type = NBT_NAME_LOGON; @@ -84,10 +86,11 @@ static bool nbt_test_netlogon(struct torture_context *tctx) /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(&name, tctx, &address, event_context_find(tctx), lp_name_resolve_order(tctx->lp_ctx)), + resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); - myaddress = talloc_strdup(dgmsock, iface_best_ip(tctx->lp_ctx, address)); + load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address)); socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, @@ -156,6 +159,8 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) const char *address; struct nbt_name name; + + struct interface *ifaces; name.name = lp_workgroup(tctx->lp_ctx); name.type = NBT_NAME_LOGON; @@ -163,10 +168,11 @@ static bool nbt_test_netlogon2(struct torture_context *tctx) /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(&name, tctx, &address, event_context_find(tctx), lp_name_resolve_order(tctx->lp_ctx)), + resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); - myaddress = talloc_strdup(dgmsock, iface_best_ip(tctx->lp_ctx, address)); + load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address)); socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, myaddress, lp_dgram_port(tctx->lp_ctx)); @@ -265,6 +271,8 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) struct socket_address *socket_address; const char *address; struct nbt_name name; + + struct interface *ifaces; name.name = lp_workgroup(tctx->lp_ctx); name.type = NBT_NAME_LOGON; @@ -272,10 +280,11 @@ static bool nbt_test_ntlogon(struct torture_context *tctx) /* do an initial name resolution to find its IP */ torture_assert_ntstatus_ok(tctx, - resolve_name(&name, tctx, &address, event_context_find(tctx), lp_name_resolve_order(tctx->lp_ctx)), + resolve_name(lp_resolve_context(tctx->lp_ctx), &name, tctx, &address, event_context_find(tctx)), talloc_asprintf(tctx, "Failed to resolve %s", name.name)); - myaddress = talloc_strdup(dgmsock, iface_best_ip(tctx->lp_ctx, address)); + load_interfaces(tctx, lp_interfaces(tctx->lp_ctx), &ifaces); + myaddress = talloc_strdup(dgmsock, iface_best_ip(ifaces, address)); socket_address = socket_address_from_strings(dgmsock, dgmsock->sock->backend_name, myaddress, lp_dgram_port(tctx->lp_ctx)); |