Got medieval on another pointless extern. Removed extern struct ipzero
authorTim Potter <tpot@samba.org>
Mon, 26 Nov 2001 03:11:44 +0000 (03:11 +0000)
committerTim Potter <tpot@samba.org>
Mon, 26 Nov 2001 03:11:44 +0000 (03:11 +0000)
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)

30 files changed:
source3/auth/auth_domain.c
source3/client/client.c
source3/client/smbmount.c
source3/client/smbspool.c
source3/lib/interface.c
source3/lib/util.c
source3/lib/wins_srv.c
source3/libsmb/cliconnect.c
source3/libsmb/libsmbclient.c
source3/nmbd/nmbd.c
source3/nmbd/nmbd_become_dmb.c
source3/nmbd/nmbd_browsesync.c
source3/nmbd/nmbd_logonnames.c
source3/nmbd/nmbd_namequery.c
source3/nmbd/nmbd_responserecordsdb.c
source3/nmbd/nmbd_subnetdb.c
source3/nmbd/nmbd_winsserver.c
source3/nmbd/nmbd_workgroupdb.c
source3/nsswitch/wins.c
source3/smbd/password.c
source3/smbwrapper/smbw.c
source3/torture/locktest.c
source3/torture/locktest2.c
source3/torture/masktest.c
source3/torture/rpctorture.c
source3/torture/torture.c
source3/utils/net.c
source3/utils/nmblookup.c
source3/utils/smbcacls.c
source3/utils/smbtree.c

index fa6093a5924ce0b0459c8167534b598d3c58b4e4..f3c2fa97e4def095af86ef1f8526e43f0f9ee53b 100644 (file)
@@ -24,8 +24,6 @@
 
 BOOL global_machine_password_needs_changing = False;
 
-extern struct in_addr ipzero;
-
 extern pstring global_myname;
 
 /***********************************************************************
@@ -183,7 +181,7 @@ static BOOL attempt_connect_to_dc(struct cli_state *pcli, struct in_addr *ip,
         * Ignore addresses we have already tried.
         */
 
-       if (ip_equal(ipzero, *ip))
+       if (is_zero_ip(*ip))
                return False;
 
        if (!lookup_pdc_name(global_myname, lp_workgroup(), ip, dc_name))
@@ -232,7 +230,7 @@ static BOOL find_connect_pdc(struct cli_state *pcli,
                if((connected_ok = attempt_connect_to_dc(pcli, &ip_list[i], trust_passwd))) 
                        break;
                
-               ip_list[i] = ipzero; /* Tried and failed. */
+               zero_ip(&ip_list[i]); /* Tried and failed. */
        }
 
        /*
@@ -242,7 +240,7 @@ static BOOL find_connect_pdc(struct cli_state *pcli,
                i = (sys_random() % count);
 
                if (!(connected_ok = attempt_connect_to_dc(pcli, &ip_list[i], trust_passwd)))
-                       ip_list[i] = ipzero; /* Tried and failed. */
+                        zero_ip(&ip_list[i]); /* Tried and failed. */
        }
 
        /*
index c684f3fea69c94f1b5bfb0efb44fb96ffc74b582..2b0867cf7b40e0d006a40a13f1d59065ae251f7e 100644 (file)
@@ -45,7 +45,6 @@ static char *cmdstr;
 static BOOL got_pass;
 static int io_bufsize = 64512;
 static BOOL use_kerberos;
-extern struct in_addr ipzero;
 
 static int name_type = 0x20;
 static int max_protocol = PROTOCOL_NT1;
@@ -2085,7 +2084,6 @@ struct cli_state *do_connect(const char *server, const char *share)
        struct nmb_name called, calling;
        const char *server_n;
        struct in_addr ip;
-       extern struct in_addr ipzero;
        fstring servicename;
        char *sharename;
        
@@ -2102,13 +2100,13 @@ struct cli_state *do_connect(const char *server, const char *share)
 
        server_n = server;
        
-       ip = ipzero;
+       zero_ip(&ip);
 
        make_nmb_name(&calling, global_myname, 0x0);
        make_nmb_name(&called , server, name_type);
 
  again:
-       ip = ipzero;
+       zero_ip(&ip);
        if (have_ip) ip = dest_ip;
 
        /* have to open a new connection */
@@ -2366,12 +2364,12 @@ static int do_message_op(void)
        struct in_addr ip;
        struct nmb_name called, calling;
 
-       ip = ipzero;
+        zero_ip(&ip);
 
        make_nmb_name(&calling, global_myname, 0x0);
        make_nmb_name(&called , desthost, name_type);
 
-       ip = ipzero;
+        zero_ip(&ip);
        if (have_ip) ip = dest_ip;
 
        if (!(cli=cli_initialise(NULL)) || (cli_set_port(cli, port) != port) || !cli_connect(cli, desthost, &ip)) {
@@ -2584,7 +2582,7 @@ static int do_message_op(void)
                case 'I':
                        {
                                dest_ip = *interpret_addr2(optarg);
-                               if (zero_ip(dest_ip))
+                               if (is_zero_ip(dest_ip))
                                        exit(1);
                                have_ip = True;
                        }
index d929599e56dabb2f8c904f47f864f70719719fd4..3aeddfabca159091d796417dcc31809d76f14ce1 100644 (file)
@@ -27,8 +27,6 @@
 #include <asm/types.h>
 #include <linux/smb_fs.h>
 
-extern struct in_addr ipzero;
-
 extern BOOL in_client;
 extern pstring user_socket_options;
 extern BOOL append_log;
@@ -119,7 +117,6 @@ static struct cli_state *do_connection(char *the_service)
        struct nmb_name called, calling;
        char *server_n;
        struct in_addr ip;
-       extern struct in_addr ipzero;
        pstring server;
        char *share;
 
@@ -143,7 +140,7 @@ static struct cli_state *do_connection(char *the_service)
        make_nmb_name(&called , server, 0x20);
 
  again:
-       ip = ipzero;
+        zero_ip(&ip);
        if (have_ip) ip = dest_ip;
 
        /* have to open a new connection */
@@ -756,7 +753,7 @@ static void parse_mount_smb(int argc, char **argv)
                                DEBUGLEVEL = val;
                        } else if(!strcmp(opts, "ip")) {
                                dest_ip = *interpret_addr2(opteq+1);
-                               if (zero_ip(dest_ip)) {
+                               if (is_zero_ip(dest_ip)) {
                                        fprintf(stderr,"Can't resolve address %s\n", opteq+1);
                                        exit(1);
                                }
index 3d049b588e1ffbe0907d60dcd510a21022a1c897..3e583e855e93342b2c4a700a3835bf6394cb96fa 100644 (file)
@@ -29,7 +29,6 @@
  */
 
 extern BOOL            in_client;      /* Boolean for client library */
-extern struct in_addr  ipzero;         /* Any address */
 
 
 /*
@@ -285,7 +284,7 @@ smb_connect(char *workgroup,                /* I - Workgroup */
 
   get_myname(myname);  
 
-  ip = ipzero;
+  zero_ip(&ip);
 
   make_nmb_name(&calling, myname, 0x0);
   make_nmb_name(&called, server, 0x20);
index d2e0b44fd4d5fc8a63a5dc1857c01ab454c9200a..a93390e643ca4f6b9cfdf0bf90b7f5f58035448f 100644 (file)
@@ -26,7 +26,6 @@
 static struct iface_struct *probed_ifaces;
 static int total_probed;
 
-struct in_addr ipzero;
 struct in_addr allones_ip;
 struct in_addr loopback_ip;
 
@@ -42,7 +41,7 @@ Try and find an interface that matches an ip. If we cannot, return NULL
 static struct interface *iface_find(struct in_addr ip, BOOL CheckMask)
 {
        struct interface *i;
-       if (zero_ip(ip)) return local_interfaces;
+       if (is_zero_ip(ip)) return local_interfaces;
 
        for (i=local_interfaces;i;i=i->next)
                if (CheckMask) {
@@ -104,8 +103,8 @@ static void interpret_interface(char *token)
        char *p;
        int i, added=0;
 
-       ip = ipzero;
-       nmask = ipzero;
+        zero_ip(&ip);
+        zero_ip(&nmask);
        
        /* first check if it is an interface name */
        for (i=0;i<total_probed;i++) {
@@ -172,7 +171,6 @@ void load_interfaces(void)
 
        ptr = lp_interfaces();
 
-       ipzero = *interpret_addr2("0.0.0.0");
        allones_ip = *interpret_addr2("255.255.255.255");
        loopback_ip = *interpret_addr2("127.0.0.1");
 
index dc948a406b3516f3394d5b5a664e57228041f734..01fb51d5a24f57183b808de2797fd7587940d5c2 100644 (file)
@@ -841,13 +841,27 @@ struct in_addr *interpret_addr2(const char *str)
 /*******************************************************************
   check if an IP is the 0.0.0.0
   ******************************************************************/
-BOOL zero_ip(struct in_addr ip)
+BOOL is_zero_ip(struct in_addr ip)
 {
   uint32 a;
   putip((char *)&a,(char *)&ip);
   return(a == 0);
 }
 
+/* Set an IP to 0.0.0.0 */
+
+void zero_ip(struct in_addr *ip)
+{
+        static BOOL init;
+        static struct in_addr ipzero;
+
+        if (!init) {
+                ipzero = *interpret_addr2("0.0.0.0");
+                init = True;
+        }
+
+        *ip = ipzero;
+}
 
 #if (defined(HAVE_NETGROUP) && defined(WITH_AUTOMOUNT))
 /******************************************************************
index 5a9b065008e661294f1c0a267cecdd412b5e0a6a..92cd51d8bbc5ef4789f702223729577bde0ef357 100644 (file)
@@ -209,11 +209,11 @@ struct in_addr wins_srv_ip( void )
     if( now >= entry->mourning )        /* Found a live one. */
       {
       /* If we don't have the IP, look it up. */
-      if( zero_ip( entry->ip_addr ) )
+      if( is_zero_ip( entry->ip_addr ) )
         entry->ip_addr = *interpret_addr2( entry->server );
 
       /* If we still don't have the IP then kill it, else return it. */
-      if( zero_ip( entry->ip_addr ) )
+      if( is_zero_ip( entry->ip_addr ) )
         entry->mourning = now + NECROMANCYCLE;
       else
         return( entry->ip_addr );
@@ -278,7 +278,7 @@ void wins_srv_died( struct in_addr boothill_ip )
   {
   list_entry *entry;
 
-  if( zero_ip( boothill_ip ) )
+  if( is_zero_ip( boothill_ip ) )
     {
     DEBUG( 4, ("wins_srv_died(): Invalid request to mark zero IP down.\n") );
     return;
index ffbc54ea5e8875689857b84cf2156a84fa2f2570..314ac6638ae55038191b01ab208a4d589ca85fe9 100644 (file)
@@ -972,12 +972,11 @@ open the client sockets
 ****************************************************************************/
 BOOL cli_connect(struct cli_state *cli, const char *host, struct in_addr *ip)
 {
-       extern struct in_addr ipzero;
        extern pstring user_socket_options;
 
        fstrcpy(cli->desthost, host);
        
-       if (!ip || ip_equal(*ip, ipzero)) {
+       if (!ip || is_zero_ip(*ip)) {
                 if (!resolve_name( cli->desthost, &cli->dest_ip, 0x20)) {
                         return False;
                 }
index ce00548518f9f19870ea156cbe9f4230a0fd1dd7..a85d9e45fc6dbd0f41f1478f898e0fbbd6f60417 100644 (file)
@@ -246,9 +246,8 @@ struct smbc_server *smbc_server(char *server, char *share,
        fstring group;
        pstring ipenv;
        struct in_addr ip;
-       extern struct in_addr ipzero;
   
-       ip = ipzero;
+        zero_ip(&ip);
        ZERO_STRUCT(c);
 
        /* try to use an existing connection */
@@ -306,7 +305,7 @@ struct smbc_server *smbc_server(char *server, char *share,
  again:
        slprintf(ipenv,sizeof(ipenv)-1,"HOST_%s", server_n);
 
-       ip = ipzero;
+        zero_ip(&ip);
 
        /* have to open a new connection */
        if (!cli_initialise(&c) || !cli_connect(&c, server_n, &ip)) {
index 314eead56501cb31b9f03259a27bdbfe5899f505..1b6547f6c34e2545b194ea85037beb72eb462b08 100644 (file)
@@ -48,8 +48,6 @@ BOOL found_lm_clients = False;
 
 time_t StartupTime = 0;
 
-extern struct in_addr ipzero;
-
 /**************************************************************************** **
   catch a sigterm
  **************************************************************************** */
index 8a9fbaedd592142e926fe360e94c51dfa406701d..d62607a643a3bd9a57f3b35ec27fe15aacc9ea28 100644 (file)
@@ -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 ) )
     {
index 6a8edd0eaf0e0323d0d7e685f4823a78a514025d..35bd29334e075647bfbc87887c1bfcea6694826b 100644 (file)
@@ -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);
index 4f48b21b7fd7c87f4d853acae3e8e284ebfe42ff..52340f1f3108c103edb87bbc0a2244b4107adc3e 100644 (file)
@@ -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. */
index 1f0895ee37fd4c0e2de3a3bbca282063dd4be25a..9d2a7a489589987ac2fc2a279c6cdd5979a26eed 100644 (file)
@@ -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
index b24c85a9d811e7e56688369745415c42204de389..63601ff26c46162fe3be6c6272c9188a647edb7a 100644 (file)
@@ -26,8 +26,6 @@
 
 extern int ClientNMB;
 
-extern struct in_addr ipzero;
-
 int num_response_packets = 0;
 
 /***************************************************************************
index ebb6bfa9c6b74b69241d42aaac7ae00cce522029..3b450f671249eedcfbc45fd3bf30b7ffb81d202b 100644 (file)
@@ -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;
index ea025e66f3d7357c04d37cd3665038cf94e665c5..ecb5f2da55b2ee6e9a12e2e977dc1cdb66a63ae1 100644 (file)
@@ -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
 *****************************************************************************/
index 3b7a64b8e5bf2f43ce57bb3defb98998d24edf5b..4551eaf46b49ada0df4de5b17c5137795b4fabd9 100644 (file)
@@ -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 */
index e23cf9ea030efc5665b3890f9003724c2d742094..abc7b6f414e0a6a88f8d1a6c6197a6c8474c5014 100644 (file)
@@ -88,13 +88,13 @@ struct in_addr *lookup_backend(const char *name, int *count)
 
 /* The next four lines commented out by JHT
    and replaced with the four lines following */
-/*     if( !zero_ip( wins_ip ) ) {
+/*     if( !is_zero_ip( wins_ip ) ) {
  *             ret = name_query( fd, name, 0x20, False, True, wins_src_ip(), count );
  *             goto out;
  *     }
  */
        p = wins_srv_ip();
-       if( !zero_ip(p) ) {
+       if( !is_zero_ip(p) ) {
                ret = name_query(fd,name,0x20,False,True, p, count);
                goto out;
        }
index 510e18919dda3dd3dbb2d7d55e7a149d2387d282..71837efdcbd44b6861d5cd3df4fa665142da0e2c 100644 (file)
@@ -21,8 +21,6 @@
 
 #include "includes.h"
 
-extern struct in_addr ipzero;
-
 /* users from session setup */
 static pstring session_users="";
 
index b4b0b28f3682f5c5e09c3c6f85a21c8337c9a1f5..047db9bb96307b8e9c51489157c4edf127336999 100644 (file)
@@ -442,9 +442,8 @@ struct smbw_server *smbw_server(char *server, char *share)
        fstring group;
        pstring ipenv;
        struct in_addr ip;
-       extern struct in_addr ipzero;
 
-       ip = ipzero;
+        zero_ip(&ip);
        ZERO_STRUCT(c);
 
        get_auth_data_fn(server, share, &workgroup, &username, &password);
@@ -495,7 +494,7 @@ struct smbw_server *smbw_server(char *server, char *share)
  again:
        slprintf(ipenv,sizeof(ipenv)-1,"HOST_%s", server_n);
 
-       ip = ipzero;
+        zero_ip(&ip);
        if ((p=smbw_getshared(ipenv))) {
                ip = *(interpret_addr2(p));
        }
index ccff2b2624a0c077060a409777ba24e7e7763433..8606c9e38a91636cc127d1542e93f1a60a6c8a83 100644 (file)
@@ -147,7 +147,6 @@ struct cli_state *connect_one(char *share)
        char *server_n;
        fstring server;
        struct in_addr ip;
-       extern struct in_addr ipzero;
        fstring myname;
        static int count;
 
@@ -159,7 +158,7 @@ struct cli_state *connect_one(char *share)
 
        server_n = server;
        
-       ip = ipzero;
+        zero_ip(&ip);
 
        slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
 
@@ -167,7 +166,7 @@ struct cli_state *connect_one(char *share)
        make_nmb_name(&called , server, 0x20);
 
  again:
-       ip = ipzero;
+        zero_ip(&ip);
 
        /* have to open a new connection */
        if (!(c=cli_initialise(NULL)) || !cli_connect(c, server_n, &ip)) {
index db5e17921c6555e6564f746ef5a4e71ad08b6675..49c8b2a8a9cb09e919d6b145af5bfdda91eef690 100644 (file)
@@ -157,7 +157,6 @@ struct cli_state *connect_one(char *share)
        char *server_n;
        fstring server;
        struct in_addr ip;
-       extern struct in_addr ipzero;
        fstring myname;
        static int count;
 
@@ -169,7 +168,7 @@ struct cli_state *connect_one(char *share)
 
        server_n = server;
        
-       ip = ipzero;
+        zero_ip(&ip);
 
        slprintf(myname,sizeof(myname), "lock-%u-%u", getpid(), count++);
 
@@ -177,7 +176,7 @@ struct cli_state *connect_one(char *share)
        make_nmb_name(&called , server, 0x20);
 
  again:
-       ip = ipzero;
+        zero_ip(&ip);
 
        /* have to open a new connection */
        if (!(c=cli_initialise(NULL)) || !cli_connect(c, server_n, &ip)) {
index d57b26bee4d64b4029a424c39a5a31f4418083f0..e8c88a9fc148adbd1bc1750bba46454fde894a81 100644 (file)
@@ -165,7 +165,6 @@ struct cli_state *connect_one(char *share)
        char *server_n;
        char *server;
        struct in_addr ip;
-       extern struct in_addr ipzero;
 
        server = share+2;
        share = strchr_m(server,'\\');
@@ -175,13 +174,13 @@ struct cli_state *connect_one(char *share)
 
        server_n = server;
        
-       ip = ipzero;
+        zero_ip(&ip);
 
        make_nmb_name(&calling, "masktest", 0x0);
        make_nmb_name(&called , server, 0x20);
 
  again:
-       ip = ipzero;
+        zero_ip(&ip);
 
        /* have to open a new connection */
        if (!(c=cli_initialise(NULL)) || !cli_connect(c, server_n, &ip)) {
index e767c715e990884f1c0beb9b35ddeb06ed88b6d9..231e3a75f567c18149ada2350f5847ada9084734 100644 (file)
@@ -409,7 +409,7 @@ enum client_action
                        case 'I':
                        {
                                cli_info.dest_ip = *interpret_addr2(optarg);
-                               if (zero_ip(cli_info.dest_ip))
+                               if (is_zero_ip(cli_info.dest_ip))
                                {
                                        exit(1);
                                }
index 234f3d3335451b1f02ba8e2a36d2e01cd785044c..bc3310886d9da230ab494450ae7c653835e1b8a1 100644 (file)
@@ -93,14 +93,13 @@ static BOOL open_nbt_connection(struct cli_state *c)
 {
        struct nmb_name called, calling;
        struct in_addr ip;
-       extern struct in_addr ipzero;
 
        ZERO_STRUCTP(c);
 
        make_nmb_name(&calling, myname, 0x0);
        make_nmb_name(&called , host, 0x20);
 
-       ip = ipzero;
+        zero_ip(&ip);
 
        if (!cli_initialise(c) || !cli_connect(c, host, &ip)) {
                printf("Failed to connect with %s\n", host);
index 224de31ebf5578ca62e244435e2a8d9580c5e64b..d0d73b59f36785ed8fad8315cfec140628accb2a 100644 (file)
@@ -286,7 +286,6 @@ static const char *share_type[] = {
 /************************************************************************************/
 
 extern int optind, opterr, optopt;
-extern struct in_addr ipzero;
 
 static struct cli_state *cli;
 static char *opt_requester_name;
@@ -355,14 +354,15 @@ static struct cli_state *connect_to_ipc(char *server)
        
        server_n = server; 
        
-       ip = ipzero;
+        zero_ip(&ip);
        make_nmb_name(&calling, opt_requester_name, 0x0);
        make_nmb_name(&called , server, 0x20);
        
 again:
        if (have_ip)
                ip = dest_ip;
-       else ip = ipzero;
+       else 
+                zero_ip(&ip);
        
        DEBUG(3,("Connecting to host=%s\\share=%s\n\n", 
                 server, "IPC$"));
@@ -1276,7 +1276,7 @@ int main(int argc,char *argv[])
        };
 
        got_pass = 0;
-       dest_ip = ipzero;
+       zero_ip(&dest_ip);
 
        dbf = x_stdout;
        
@@ -1291,7 +1291,7 @@ int main(int argc,char *argv[])
                        break;
                case 'I':
                        dest_ip = *interpret_addr2(poptGetOptArg(pc));
-                       if (zero_ip(dest_ip))
+                       if (is_zero_ip(dest_ip))
                                d_printf(ERRMSG_INVALID_IPADDRESS);
                        else
                                have_ip = True;
index cad9bf85c354caae8500206142220cb803203fdb..5b22872cb37f80e5d3408b0c571eca136578495e 100644 (file)
@@ -24,8 +24,6 @@
 
 #include "includes.h"
 
-extern struct in_addr ipzero;
-
 static BOOL use_bcast = True;
 static BOOL got_bcast = False;
 static struct in_addr bcast_addr;
index ae03e193e1881962a97f1ecfdbc9e919dbaa6565..2605442e8a592aef58f82fa9c50b83398c5f9adc 100644 (file)
@@ -690,7 +690,6 @@ struct cli_state *connect_one(char *share)
        struct cli_state *c;
        struct nmb_name called, calling;
        struct in_addr ip;
-       extern struct in_addr ipzero;
        extern pstring global_myname;
 
        fstrcpy(server,share+2);
@@ -699,13 +698,13 @@ struct cli_state *connect_one(char *share)
        *share = 0;
        share++;
 
-       ip = ipzero;
+        zero_ip(&ip);
 
        make_nmb_name(&calling, global_myname, 0x0);
        make_nmb_name(&called , server, 0x20);
 
  again:
-       ip = ipzero;
+        zero_ip(&ip);
 
        /* have to open a new connection */
        if (!(c=cli_initialise(NULL)) || !cli_connect(c, server, &ip)) {
index 13df0451f0f6f8c652ddec826439c40ed73df6e0..5b7e8a73c1d05196b0df4bcb62bb429031b7906c 100644 (file)
@@ -94,11 +94,12 @@ static struct cli_state *get_ipc_connect(char *server,
                                          struct user_auth_info *user_info)
 {
         struct nmb_name calling, called;
-        extern struct in_addr ipzero;
-        struct in_addr server_ip = ipzero;
+        struct in_addr server_ip;
         struct cli_state *cli;
         pstring myname;
 
+        zero_ip(&server_ip);
+
         get_myname(myname);
 
         make_nmb_name(&called, myname, 0x0);