mirror of
https://github.com/samba-team/samba.git
synced 2025-03-26 18:50:30 +03:00
r26408: Remove use of global_loadparm.
(This used to be commit f933b4362124bfdd25544b4e27992d9ca4405848)
This commit is contained in:
parent
46b54defe9
commit
33582dffcc
@ -43,6 +43,7 @@ struct finddcs_state {
|
||||
|
||||
int num_dcs;
|
||||
struct nbt_dc_name *dcs;
|
||||
uint16_t nbt_port;
|
||||
};
|
||||
|
||||
static void finddcs_name_resolved(struct composite_context *ctx);
|
||||
@ -82,6 +83,7 @@ struct composite_context *finddcs_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
state->ctx = c;
|
||||
|
||||
state->nbt_port = lp_nbt_port(global_loadparm);
|
||||
state->my_netbios_name = talloc_strdup(state, my_netbios_name);
|
||||
state->domain_name = talloc_strdup(state, domain_name);
|
||||
if (composite_nomem(state->domain_name, c)) return c;
|
||||
@ -177,7 +179,7 @@ static void finddcs_getdc_replied(struct irpc_request *ireq)
|
||||
composite_done(state->ctx);
|
||||
}
|
||||
|
||||
/* The GetDC request might not be availible (such as occours when the
|
||||
/* The GetDC request might not be available (such as occours when the
|
||||
* NBT server is down). Fallback to a node status. It is the best
|
||||
* hope we have... */
|
||||
static void fallback_node_status(struct finddcs_state *state)
|
||||
@ -189,7 +191,7 @@ static void fallback_node_status(struct finddcs_state *state)
|
||||
state->node_status.in.name.type = NBT_NAME_CLIENT;
|
||||
state->node_status.in.name.scope = NULL;
|
||||
state->node_status.in.dest_addr = state->dcs[0].address;
|
||||
state->node_status.in.dest_port = lp_nbt_port(global_loadparm);
|
||||
state->node_status.in.dest_port = state->nbt_port;
|
||||
state->node_status.in.timeout = 1;
|
||||
state->node_status.in.retries = 2;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -51,7 +51,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_JoinSite *r)
|
||||
/* Resolve the site name. */
|
||||
ZERO_STRUCT(search);
|
||||
search.in.dest_address = r->in.dest_address;
|
||||
search.in.dest_port = lp_cldap_port(global_loadparm);
|
||||
search.in.dest_port = r->in.cldap_port;
|
||||
search.in.acct_control = -1;
|
||||
search.in.version = 6;
|
||||
|
||||
@ -158,6 +158,7 @@ NTSTATUS libnet_JoinSite(struct ldb_context *remote_ldb,
|
||||
r->in.dest_address = dest_addr;
|
||||
r->in.netbios_name = libnet_r->in.netbios_name;
|
||||
r->in.domain_dn_str = libnet_r->out.domain_dn_str;
|
||||
r->in.cldap_port = lp_cldap_port(global_loadparm);
|
||||
|
||||
status = libnet_FindSite(tmp_ctx, r);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
|
@ -22,6 +22,7 @@ struct libnet_JoinSite {
|
||||
const char *dest_address;
|
||||
const char *netbios_name;
|
||||
const char *domain_dn_str;
|
||||
uint16_t cldap_port;
|
||||
} in;
|
||||
|
||||
struct {
|
||||
|
@ -211,6 +211,7 @@ static void nbtd_register_name_iface(struct nbtd_interface *iface,
|
||||
/* setup a broadcast name registration request */
|
||||
io.in.name = iname->name;
|
||||
io.in.dest_addr = iface->bcast_address;
|
||||
io.in.dest_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
|
||||
io.in.address = iface->ip_address;
|
||||
io.in.nb_flags = nb_flags;
|
||||
io.in.ttl = iname->ttl;
|
||||
|
@ -141,6 +141,7 @@ static void nbtd_wins_refresh(struct event_context *ev, struct timed_event *te,
|
||||
/* setup a wins name refresh request */
|
||||
io.in.name = iname->name;
|
||||
io.in.wins_servers = str_list_make(tmp_ctx, iname->wins_server, NULL);
|
||||
io.in.wins_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
|
||||
io.in.addresses = nbtd_address_list(iface, tmp_ctx);
|
||||
io.in.nb_flags = iname->nb_flags;
|
||||
io.in.ttl = iname->ttl;
|
||||
|
@ -378,6 +378,7 @@ static void wins_register_wack(struct nbt_name_socket *nbtsock,
|
||||
if (talloc_reference(s, src) == NULL) goto failed;
|
||||
|
||||
s->io.in.nbtd_server = iface->nbtsrv;
|
||||
s->io.in.nbtd_port = lp_nbt_port(iface->nbtsrv->task->lp_ctx);
|
||||
s->io.in.event_ctx = iface->nbtsrv->task->event_ctx;
|
||||
s->io.in.name = rec->name;
|
||||
s->io.in.num_addresses = winsdb_addr_list_length(rec->addresses);
|
||||
|
@ -51,6 +51,7 @@ struct wins_server {
|
||||
struct wins_challenge_io {
|
||||
struct {
|
||||
struct nbtd_server *nbtd_server;
|
||||
uint16_t nbt_port;
|
||||
struct event_context *event_ctx;
|
||||
struct nbt_name *name;
|
||||
uint32_t num_addresses;
|
||||
|
@ -47,7 +47,7 @@ static void wins_challenge_handler(struct nbt_name_request *req)
|
||||
if (state->current_address < state->io->in.num_addresses) {
|
||||
struct nbtd_interface *iface;
|
||||
|
||||
state->query.in.dest_port = lp_nbt_port(global_loadparm);
|
||||
state->query.in.dest_port = state->io->in.nbt_port;
|
||||
state->query.in.dest_addr = state->io->in.addresses[state->current_address];
|
||||
|
||||
iface = nbtd_find_request_iface(state->io->in.nbtd_server, state->query.in.dest_addr, true);
|
||||
@ -105,7 +105,7 @@ struct composite_context *wins_challenge_send(TALLOC_CTX *mem_ctx, struct wins_c
|
||||
|
||||
/* setup a name query to the first address */
|
||||
state->query.in.name = *state->io->in.name;
|
||||
state->query.in.dest_port = lp_nbt_port(global_loadparm);
|
||||
state->query.in.dest_port = state->io->in.nbt_port;
|
||||
state->query.in.dest_addr = state->io->in.addresses[state->current_address];
|
||||
state->query.in.broadcast = false;
|
||||
state->query.in.wins_lookup = true;
|
||||
@ -162,6 +162,7 @@ static void wins_release_demand_handler(struct nbt_name_request *req)
|
||||
if (state->current_address < state->io->in.num_addresses) {
|
||||
struct nbtd_interface *iface;
|
||||
|
||||
state->release.in.dest_port = lp_nbt_port(global_loadparm);
|
||||
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
|
||||
state->release.in.address = state->release.in.dest_addr;
|
||||
state->release.in.timeout = (state->addresses_left > 1 ? 2 : 1);
|
||||
@ -221,6 +222,7 @@ static struct composite_context *wins_release_demand_send(TALLOC_CTX *mem_ctx, s
|
||||
* with 2 retries
|
||||
*/
|
||||
state->release.in.name = *state->io->in.name;
|
||||
state->release.in.dest_port = lp_nbt_port(global_loadparm);
|
||||
state->release.in.dest_addr = state->io->in.addresses[state->current_address];
|
||||
state->release.in.address = state->release.in.dest_addr;
|
||||
state->release.in.broadcast = false;
|
||||
@ -303,6 +305,7 @@ NTSTATUS nbtd_proxy_wins_challenge(struct irpc_message *msg,
|
||||
s->req = req;
|
||||
|
||||
s->io.in.nbtd_server = nbtd_server;
|
||||
s->io.in.nbt_port = lp_nbt_port(global_loadparm);
|
||||
s->io.in.event_ctx = msg->ev;
|
||||
s->io.in.name = &req->in.name;
|
||||
s->io.in.num_addresses = req->in.num_addrs;
|
||||
|
@ -80,6 +80,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
|
||||
|
||||
torture_comment(tctx, "release the name\n");
|
||||
release.in.name = *name;
|
||||
release.in.dest_port = lp_nbt_port(tctx->lp_ctx);
|
||||
release.in.dest_addr = address;
|
||||
release.in.address = myaddress;
|
||||
release.in.nb_flags = nb_flags;
|
||||
@ -165,6 +166,7 @@ static bool nbt_test_wins_name(struct torture_context *tctx, const char *address
|
||||
|
||||
torture_comment(tctx, "refresh the name\n");
|
||||
refresh.in.name = *name;
|
||||
refresh.in.wins_port = lp_nbt_port(tctx->lp_ctx);
|
||||
refresh.in.wins_servers = str_list_make(tctx, address, NULL);
|
||||
refresh.in.addresses = str_list_make(tctx, myaddress, NULL);
|
||||
refresh.in.nb_flags = nb_flags;
|
||||
|
@ -87,7 +87,7 @@ static void generate_register(struct nbt_name_socket *nbtsock, struct wins_state
|
||||
|
||||
io.in.name = generate_name(tmp_ctx, idx);
|
||||
io.in.dest_addr = state->wins_server;
|
||||
io.in.dest_port = lp_nbt_port(global_loadparm);
|
||||
io.in.dest_port = state->wins_port;
|
||||
io.in.address = state->my_ip;
|
||||
io.in.nb_flags = NBT_NODE_H;
|
||||
io.in.register_demand = false;
|
||||
@ -139,6 +139,7 @@ static void generate_release(struct nbt_name_socket *nbtsock, struct wins_state
|
||||
istate->state = state;
|
||||
|
||||
io.in.name = generate_name(tmp_ctx, idx);
|
||||
io.in.dest_port = lp_nbt_port(global_loadparm);
|
||||
io.in.dest_addr = state->wins_server;
|
||||
io.in.address = state->my_ip;
|
||||
io.in.nb_flags = NBT_NODE_H;
|
||||
|
@ -6562,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;
|
||||
@ -6616,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;
|
||||
@ -9368,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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user