From 51a0354d751f48a2542984c81e218da33669bbeb Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sat, 3 Nov 2007 22:34:46 -0700 Subject: Remove more static data from lib/util_sock.c and callers. Jeremy. (This used to be commit 35aaa36f82c70964cee5d0778eb04547b226dd3f) --- source3/nmbd/nmbd_mynames.c | 5 +++-- source3/nmbd/nmbd_sendannounce.c | 4 ++-- source3/nmbd/nmbd_winsserver.c | 22 ++++++++++++++-------- 3 files changed, 19 insertions(+), 12 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd_mynames.c b/source3/nmbd/nmbd_mynames.c index 2eb376fc17..62c8dd0cf0 100644 --- a/source3/nmbd/nmbd_mynames.c +++ b/source3/nmbd/nmbd_mynames.c @@ -162,12 +162,13 @@ bool register_my_workgroup_and_names(void) for(subrec = FIRST_SUBNET; subrec; subrec = subrec->next) { for (n=0;nsubnet_name )); for (ptr=s; next_token(&ptr,s2,NULL,sizeof(s2)); ) { /* The entries are of the form a.b.c.d */ - addr = *interpret_addr2(s2); + (void)interpret_addr2(&addr,s2); DEBUG(5,("announce_remote: Doing remote browse sync announce for server %s to IP %s.\n", global_myname(), inet_ntoa(addr) )); diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 736bbf4068..d4a2c8346e 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -680,7 +680,7 @@ bool initialise_wins(void) next_token(&ptr,ttl_str,NULL,sizeof(ttl_str)); for(i = 0; i < num_ips; i++) { next_token(&ptr, ip_str, NULL, sizeof(ip_str)); - ip_list[i] = *interpret_addr2(ip_str); + (void)interpret_addr2(&ip_list[i], ip_str); } next_token(&ptr,nb_flags_str,NULL, sizeof(nb_flags_str)); @@ -810,8 +810,9 @@ void wins_process_name_refresh_request( struct subnet_record *subrec, struct name_record *namerec = NULL; int ttl = get_ttl_from_packet(nmb); struct in_addr from_ip; - struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0"); + struct in_addr our_fake_ip; + (void)interpret_addr2(&our_fake_ip, "0.0.0.0"); putip( (char *)&from_ip, &nmb->additional->rdata[2] ); if(bcast) { @@ -1116,8 +1117,9 @@ void wins_process_name_registration_request(struct subnet_record *subrec, struct name_record *namerec = NULL; struct in_addr from_ip; bool registering_group_name = (nb_flags & NB_GROUP) ? True : False; - struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0"); + struct in_addr our_fake_ip; + (void)interpret_addr2(&our_fake_ip, "0.0.0.0"); putip((char *)&from_ip,&nmb->additional->rdata[2]); if(bcast) { @@ -1192,7 +1194,7 @@ to register name %s. Name already exists in WINS with source type %d.\n", */ if(registering_group_name && (question->name_type != 0x1c)) { - from_ip = *interpret_addr2("255.255.255.255"); + (void)interpret_addr2(&from_ip, "255.255.255.255"); } /* @@ -1397,8 +1399,9 @@ static void wins_multihomed_register_query_success(struct subnet_record *subrec, struct name_record *namerec = NULL; struct in_addr from_ip; int ttl; - struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0"); + struct in_addr our_fake_ip; + (void)interpret_addr2(&our_fake_ip, "0.0.0.0"); memcpy((char *)&orig_reg_packet, userdata->data, sizeof(struct packet_struct *)); nmb = &orig_reg_packet->packet.nmb; @@ -1486,9 +1489,10 @@ void wins_process_multihomed_name_registration_request( struct subnet_record *su struct name_record *namerec = NULL; struct in_addr from_ip; bool group = (nb_flags & NB_GROUP) ? True : False; - struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0"); + struct in_addr our_fake_ip; unstring qname; + (void)interpret_addr2(&our_fake_ip, "0.0.0.0"); putip((char *)&from_ip,&nmb->additional->rdata[2]); if(bcast) { @@ -2112,8 +2116,9 @@ static int wins_processing_traverse_fn(TDB_CONTEXT *tdb, TDB_DATA kbuf, TDB_DATA time_t t = *(time_t *)state; bool store_record = False; struct name_record *namerec = NULL; - struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0"); + struct in_addr our_fake_ip; + (void)interpret_addr2(&our_fake_ip, "0.0.0.0"); if (kbuf.dsize != sizeof(unstring) + 1) { return 0; } @@ -2381,9 +2386,10 @@ void nmbd_wins_new_entry(struct messaging_context *msg, struct name_record *new_namerec = NULL; struct nmb_name question; bool overwrite=False; - struct in_addr our_fake_ip = *interpret_addr2("0.0.0.0"); + struct in_addr our_fake_ip; int i; + (void)interpret_addr2(&our_fake_ip, "0.0.0.0"); if (buf==NULL) { return; } -- cgit