summaryrefslogtreecommitdiff
path: root/source4/libcli/nbt/namerefresh.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/nbt/namerefresh.c')
-rw-r--r--source4/libcli/nbt/namerefresh.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source4/libcli/nbt/namerefresh.c b/source4/libcli/nbt/namerefresh.c
index d723eed9f5..1157c110a1 100644
--- a/source4/libcli/nbt/namerefresh.c
+++ b/source4/libcli/nbt/namerefresh.c
@@ -69,7 +69,7 @@ struct nbt_name_request *nbt_name_refresh_send(struct nbt_name_socket *nbtsock,
dest = socket_address_from_strings(nbtsock,
nbtsock->sock->backend_name,
- io->in.dest_addr, lp_nbt_port(global_loadparm));
+ io->in.dest_addr, io->in.dest_port);
if (dest == NULL) goto failed;
req = nbt_name_request_send(nbtsock, dest, packet,
io->in.timeout, io->in.retries, false);
@@ -137,7 +137,7 @@ NTSTATUS nbt_name_refresh(struct nbt_name_socket *nbtsock,
-/*
+/**
a wins name refresh with multiple WINS servers and multiple
addresses to refresh. Try each WINS server in turn, until we get a
reply for each address
@@ -146,13 +146,14 @@ struct refresh_wins_state {
struct nbt_name_socket *nbtsock;
struct nbt_name_refresh *io;
const char **wins_servers;
+ uint16_t wins_port;
const char **addresses;
int address_idx;
struct nbt_name_request *req;
};
-/*
+/**
state handler for WINS multi-homed multi-server name refresh
*/
static void name_refresh_wins_handler(struct nbt_name_request *req)
@@ -174,6 +175,7 @@ static void name_refresh_wins_handler(struct nbt_name_request *req)
goto done;
}
state->io->in.dest_addr = state->wins_servers[0];
+ state->io->in.dest_port = state->wins_port;
state->io->in.address = state->addresses[0];
state->req = nbt_name_refresh_send(state->nbtsock, state->io);
if (state->req == NULL) {
@@ -212,7 +214,7 @@ done:
}
}
-/*
+/**
the async send call for a multi-server WINS refresh
*/
struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_socket *nbtsock,
@@ -230,6 +232,7 @@ struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_socket *nbt
state->io = talloc(state, struct nbt_name_refresh);
if (state->io == NULL) goto failed;
+ state->wins_port = io->in.wins_port;
state->wins_servers = str_list_copy(state, io->in.wins_servers);
if (state->wins_servers == NULL ||
state->wins_servers[0] == NULL) goto failed;
@@ -240,6 +243,7 @@ struct composite_context *nbt_name_refresh_wins_send(struct nbt_name_socket *nbt
state->io->in.name = io->in.name;
state->io->in.dest_addr = state->wins_servers[0];
+ state->io->in.dest_port = state->wins_port;
state->io->in.address = io->in.addresses[0];
state->io->in.nb_flags = io->in.nb_flags;
state->io->in.broadcast = false;