From 585d0efbc6428e5876d354fee49c241c1bad809d Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Mon, 26 Nov 2001 03:11:44 +0000 Subject: Got medieval on another pointless extern. Removed extern struct ipzero and replaced with two functions: void zero_ip(struct in_adder *ip); BOOL is_zero_ip(struct in_addr ip); (This used to be commit 778f5f77a66cda76348a7c6f64cd63afe2bfe077) --- source3/nmbd/nmbd.c | 2 -- source3/nmbd/nmbd_become_dmb.c | 3 +-- source3/nmbd/nmbd_browsesync.c | 5 ++--- source3/nmbd/nmbd_logonnames.c | 1 - source3/nmbd/nmbd_namequery.c | 6 +++--- source3/nmbd/nmbd_responserecordsdb.c | 2 -- source3/nmbd/nmbd_subnetdb.c | 11 ++++++----- source3/nmbd/nmbd_winsserver.c | 2 -- source3/nmbd/nmbd_workgroupdb.c | 3 +-- 9 files changed, 13 insertions(+), 22 deletions(-) (limited to 'source3/nmbd') diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c index 314eead565..1b6547f6c3 100644 --- a/source3/nmbd/nmbd.c +++ b/source3/nmbd/nmbd.c @@ -48,8 +48,6 @@ BOOL found_lm_clients = False; time_t StartupTime = 0; -extern struct in_addr ipzero; - /**************************************************************************** ** catch a sigterm **************************************************************************** */ diff --git a/source3/nmbd/nmbd_become_dmb.c b/source3/nmbd/nmbd_become_dmb.c index 8a9fbaedd5..d62607a643 100644 --- a/source3/nmbd/nmbd_become_dmb.c +++ b/source3/nmbd/nmbd_become_dmb.c @@ -27,7 +27,6 @@ extern pstring global_myname; extern fstring global_myworkgroup; extern char **my_netbios_names; -extern struct in_addr ipzero; extern struct in_addr allones_ip; extern uint16 samba_nb_type; /* Samba's NetBIOS type. */ @@ -214,7 +213,7 @@ static void become_domain_master_query_success(struct subnet_record *subrec, /* BUG note. Samba 1.9.16p11 servers seem to return the broadcast address or zero ip for this query. Pretend this is ok. */ - if(ismyip(ip) || ip_equal(allones_ip, ip) || ip_equal(ipzero, ip)) + if(ismyip(ip) || ip_equal(allones_ip, ip) || is_zero_ip(ip)) { if( DEBUGLVL( 3 ) ) { diff --git a/source3/nmbd/nmbd_browsesync.c b/source3/nmbd/nmbd_browsesync.c index 6a8edd0eaf..35bd29334e 100644 --- a/source3/nmbd/nmbd_browsesync.c +++ b/source3/nmbd/nmbd_browsesync.c @@ -25,7 +25,6 @@ #include "includes.h" #include "smb.h" -extern struct in_addr ipzero; extern pstring global_myname; extern fstring global_myworkgroup; @@ -308,7 +307,7 @@ static void find_domain_master_name_query_success(struct subnet_record *subrec, /* First check if we already have a dmb for this workgroup. */ - if(!ip_equal(work->dmb_addr, ipzero) && ip_equal(work->dmb_addr, answer_ip)) + if(!is_zero_ip(work->dmb_addr) && ip_equal(work->dmb_addr, answer_ip)) { /* Do the local master browser announcement to the domain master browser name and IP. */ @@ -319,7 +318,7 @@ static void find_domain_master_name_query_success(struct subnet_record *subrec, return; } else - putip((char *)&work->dmb_addr, &ipzero); + zero_ip(&work->dmb_addr); /* Now initiate the node status request. */ make_nmb_name(&nmbname,"*",0x0); diff --git a/source3/nmbd/nmbd_logonnames.c b/source3/nmbd/nmbd_logonnames.c index 4f48b21b7f..52340f1f31 100644 --- a/source3/nmbd/nmbd_logonnames.c +++ b/source3/nmbd/nmbd_logonnames.c @@ -27,7 +27,6 @@ extern pstring global_myname; extern fstring global_myworkgroup; extern char **my_netbios_names; -extern struct in_addr ipzero; extern struct in_addr allones_ip; extern uint16 samba_nb_type; /* Samba's NetBIOS type. */ diff --git a/source3/nmbd/nmbd_namequery.c b/source3/nmbd/nmbd_namequery.c index 1f0895ee37..9d2a7a4895 100644 --- a/source3/nmbd/nmbd_namequery.c +++ b/source3/nmbd/nmbd_namequery.c @@ -24,8 +24,6 @@ #include "includes.h" -extern struct in_addr ipzero; - /**************************************************************************** Deal with a response packet when querying a name. ****************************************************************************/ @@ -38,7 +36,9 @@ static void query_name_response( struct subnet_record *subrec, BOOL success = False; struct nmb_name *question_name = &rrec->packet->packet.nmb.question.question_name; - struct in_addr answer_ip = ipzero; + struct in_addr answer_ip; + + zero_ip(&answer_ip); /* Ensure we don't retry the query but leave the response record cleanup to the timeout code. We may get more answer responses in which case diff --git a/source3/nmbd/nmbd_responserecordsdb.c b/source3/nmbd/nmbd_responserecordsdb.c index b24c85a9d8..63601ff26c 100644 --- a/source3/nmbd/nmbd_responserecordsdb.c +++ b/source3/nmbd/nmbd_responserecordsdb.c @@ -26,8 +26,6 @@ extern int ClientNMB; -extern struct in_addr ipzero; - int num_response_packets = 0; /*************************************************************************** diff --git a/source3/nmbd/nmbd_subnetdb.c b/source3/nmbd/nmbd_subnetdb.c index ebb6bfa9c6..3b450f6712 100644 --- a/source3/nmbd/nmbd_subnetdb.c +++ b/source3/nmbd/nmbd_subnetdb.c @@ -33,7 +33,6 @@ extern int global_nmb_port; extern fstring myworkgroup; extern char **my_netbios_names; -extern struct in_addr ipzero; /* This is the broadcast subnets database. */ struct subnet_record *subnetlist = NULL; @@ -232,7 +231,7 @@ BOOL create_subnets(void) { int num_interfaces = iface_count(); int i; - struct in_addr unicast_ip; + struct in_addr unicast_ip, ipzero; extern struct in_addr loopback_ip; if(num_interfaces == 0) @@ -280,7 +279,7 @@ BOOL create_subnets(void) struct in_addr real_wins_ip; real_wins_ip = wins_srv_ip(); - if (!zero_ip(real_wins_ip)) + if (!is_zero_ip(real_wins_ip)) { unicast_ip = real_wins_ip; } @@ -302,7 +301,7 @@ BOOL create_subnets(void) { /* We should not be using a WINS server at all. Set the ip address of the subnet to be zero. */ - unicast_ip = ipzero; + zero_ip(&unicast_ip); } /* @@ -315,6 +314,8 @@ BOOL create_subnets(void) unicast_subnet = make_subnet( "UNICAST_SUBNET", UNICAST_SUBNET, unicast_ip, unicast_ip, unicast_ip); + zero_ip(&ipzero); + remote_broadcast_subnet = make_subnet( "REMOTE_BROADCAST_SUBNET", REMOTE_BROADCAST_SUBNET, ipzero, ipzero, ipzero); @@ -347,7 +348,7 @@ BOOL we_are_a_wins_client(void) static int cache_we_are_a_wins_client = -1; if(cache_we_are_a_wins_client == -1) - cache_we_are_a_wins_client = (ip_equal(ipzero, unicast_subnet->myip) ? + cache_we_are_a_wins_client = (is_zero_ip(unicast_subnet->myip) ? False : True); return cache_we_are_a_wins_client; diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index ea025e66f3..ecb5f2da55 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -26,8 +26,6 @@ #define WINS_LIST "wins.dat" #define WINS_VERSION 1 -extern struct in_addr ipzero; - /**************************************************************************** possibly call the WINS hook external program when a WINS change is made *****************************************************************************/ diff --git a/source3/nmbd/nmbd_workgroupdb.c b/source3/nmbd/nmbd_workgroupdb.c index 3b7a64b8e5..4551eaf46b 100644 --- a/source3/nmbd/nmbd_workgroupdb.c +++ b/source3/nmbd/nmbd_workgroupdb.c @@ -31,7 +31,6 @@ extern pstring global_myname; extern fstring global_myworkgroup; extern char **my_netbios_names; extern uint16 samba_nb_type; -extern struct in_addr ipzero; int workgroup_count = 0; /* unique index key: one for each workgroup */ @@ -101,7 +100,7 @@ static struct work_record *create_workgroup(const char *name, int ttl) /* No known domain master browser as yet. */ *work->dmb_name.name = '\0'; - putip((char *)&work->dmb_addr, &ipzero); + zero_ip(&work->dmb_addr); /* WfWg uses 01040b01 */ /* Win95 uses 01041501 */ -- cgit