From 33582dffcc2d348dc042edfdcccee7500b21d928 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 12 Dec 2007 02:15:20 +0100 Subject: r26408: Remove use of global_loadparm. (This used to be commit f933b4362124bfdd25544b4e27992d9ca4405848) --- source4/libcli/nbt/libnbt.h | 4 ++++ source4/libcli/nbt/namerefresh.c | 6 ++++-- source4/libcli/nbt/nameregister.c | 8 +++++--- source4/libcli/nbt/namerelease.c | 2 +- source4/libcli/nbt/nbtsocket.c | 2 +- 5 files changed, 15 insertions(+), 7 deletions(-) (limited to 'source4/libcli/nbt') diff --git a/source4/libcli/nbt/libnbt.h b/source4/libcli/nbt/libnbt.h index 524391917d..c95d99db54 100644 --- a/source4/libcli/nbt/libnbt.h +++ b/source4/libcli/nbt/libnbt.h @@ -186,6 +186,7 @@ struct nbt_name_register_bcast { struct { struct nbt_name name; const char *dest_addr; + uint16_t dest_port; const char *address; uint16_t nb_flags; uint32_t ttl; @@ -199,6 +200,7 @@ struct nbt_name_register_wins { struct { struct nbt_name name; const char **wins_servers; + uint16_t wins_port; const char **addresses; uint16_t nb_flags; uint32_t ttl; @@ -238,6 +240,7 @@ struct nbt_name_refresh_wins { struct { struct nbt_name name; const char **wins_servers; + uint16_t wins_port; const char **addresses; uint16_t nb_flags; uint32_t ttl; @@ -254,6 +257,7 @@ struct nbt_name_release { struct { struct nbt_name name; const char *dest_addr; + uint16_t dest_port; const char *address; uint16_t nb_flags; bool broadcast; diff --git a/source4/libcli/nbt/namerefresh.c b/source4/libcli/nbt/namerefresh.c index 8408b4e3c3..1157c110a1 100644 --- a/source4/libcli/nbt/namerefresh.c +++ b/source4/libcli/nbt/namerefresh.c @@ -146,6 +146,7 @@ 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; @@ -174,7 +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 = lp_nbt_port(global_loadparm); + 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) { @@ -231,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; @@ -241,7 +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 = lp_nbt_port(global_loadparm); + 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; diff --git a/source4/libcli/nbt/nameregister.c b/source4/libcli/nbt/nameregister.c index 9389981647..3d7ab7f72f 100644 --- a/source4/libcli/nbt/nameregister.c +++ b/source4/libcli/nbt/nameregister.c @@ -224,7 +224,7 @@ struct composite_context *nbt_name_register_bcast_send(struct nbt_name_socket *n state->io->in.name = io->in.name; state->io->in.dest_addr = io->in.dest_addr; - state->io->in.dest_port = lp_nbt_port(global_loadparm); + state->io->in.dest_port = io->in.dest_port; state->io->in.address = io->in.address; state->io->in.nb_flags = io->in.nb_flags; state->io->in.register_demand = false; @@ -284,6 +284,7 @@ struct register_wins_state { struct nbt_name_socket *nbtsock; struct nbt_name_register *io; const char **wins_servers; + uint16_t wins_port; const char **addresses; int address_idx; struct nbt_name_request *req; @@ -312,7 +313,7 @@ static void name_register_wins_handler(struct nbt_name_request *req) goto done; } state->io->in.dest_addr = state->wins_servers[0]; - state->io->in.dest_port = lp_nbt_port(global_loadparm); + state->io->in.dest_port = state->wins_port; state->io->in.address = state->addresses[0]; state->req = nbt_name_register_send(state->nbtsock, state->io); if (state->req == NULL) { @@ -369,6 +370,7 @@ struct composite_context *nbt_name_register_wins_send(struct nbt_name_socket *nb state->io = talloc(state, struct nbt_name_register); if (state->io == NULL) goto failed; + state->wins_port = lp_nbt_port(global_loadparm); state->wins_servers = str_list_copy(state, io->in.wins_servers); if (state->wins_servers == NULL || state->wins_servers[0] == NULL) goto failed; @@ -379,7 +381,7 @@ struct composite_context *nbt_name_register_wins_send(struct nbt_name_socket *nb state->io->in.name = io->in.name; state->io->in.dest_addr = state->wins_servers[0]; - state->io->in.dest_port = lp_nbt_port(global_loadparm); + 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; diff --git a/source4/libcli/nbt/namerelease.c b/source4/libcli/nbt/namerelease.c index 1b3c9ae17e..d735892516 100644 --- a/source4/libcli/nbt/namerelease.c +++ b/source4/libcli/nbt/namerelease.c @@ -67,7 +67,7 @@ struct nbt_name_request *nbt_name_release_send(struct nbt_name_socket *nbtsock, talloc_strdup(packet->additional, io->in.address); dest = socket_address_from_strings(packet, 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); diff --git a/source4/libcli/nbt/nbtsocket.c b/source4/libcli/nbt/nbtsocket.c index 1f34b4583b..743f2b0f19 100644 --- a/source4/libcli/nbt/nbtsocket.c +++ b/source4/libcli/nbt/nbtsocket.c @@ -150,7 +150,7 @@ static void nbt_name_socket_timeout(struct event_context *ev, struct timed_event -/* +/** handle recv events on a nbt name socket */ static void nbt_name_socket_recv(struct nbt_name_socket *nbtsock) -- cgit