summaryrefslogtreecommitdiff
path: root/source/nmbd
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-11-03 22:34:46 -0700
committerJeremy Allison <jra@samba.org>2007-11-03 22:34:46 -0700
commit35aaa36f82c70964cee5d0778eb04547b226dd3f (patch)
tree2ab71547d481d8cc65019951a898cb679e3a837e /source/nmbd
parent62b5ca3334598aec3304d21118f67702afc3854a (diff)
downloadsamba-35aaa36f82c70964cee5d0778eb04547b226dd3f.tar.gz
Remove more static data from lib/util_sock.c and
callers. Jeremy.
Diffstat (limited to 'source/nmbd')
-rw-r--r--source/nmbd/nmbd_mynames.c5
-rw-r--r--source/nmbd/nmbd_sendannounce.c4
-rw-r--r--source/nmbd/nmbd_winsserver.c22
3 files changed, 19 insertions, 12 deletions
diff --git a/source/nmbd/nmbd_mynames.c b/source/nmbd/nmbd_mynames.c
index 2eb376fc179..62c8dd0cf0b 100644
--- a/source/nmbd/nmbd_mynames.c
+++ b/source/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;n<ARRAY_SIZE(name_types);n++) {
struct name_record *namerec;
- struct nmb_name nmbname;
+ struct nmb_name nmbname;
+ struct in_addr ip;
make_nmb_name(&nmbname, my_netbios_names(i), name_types[n]);
namerec = find_name_on_subnet(unicast_subnet, &nmbname, FIND_SELF_NAME);
if (namerec == NULL) continue;
for (a=0;cluster_addresses[a];a++) {
- add_ip_to_name_record(namerec, *interpret_addr2(cluster_addresses[a]));
+ add_ip_to_name_record(namerec, *interpret_addr2(&ip, cluster_addresses[a]));
}
}
}
diff --git a/source/nmbd/nmbd_sendannounce.c b/source/nmbd/nmbd_sendannounce.c
index 6670c55bf31..56cd4975680 100644
--- a/source/nmbd/nmbd_sendannounce.c
+++ b/source/nmbd/nmbd_sendannounce.c
@@ -488,7 +488,7 @@ void announce_remote(time_t t)
else
wgroup = pwgroup;
- addr = *interpret_addr2(s2);
+ (void)interpret_addr2(&addr,s2);
/* Announce all our names including aliases */
/* Give the ip address as the address of our first
@@ -569,7 +569,7 @@ for workgroup %s on subnet %s.\n", lp_workgroup(), FIRST_SUBNET->subnet_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/source/nmbd/nmbd_winsserver.c b/source/nmbd/nmbd_winsserver.c
index 736bbf4068e..d4a2c8346e4 100644
--- a/source/nmbd/nmbd_winsserver.c
+++ b/source/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;
}