The function add_name_to_subnet(), in file nmbd_namelistdb.c, returns a
authorChristopher R. Hertel <crh@samba.org>
Tue, 23 Jun 1998 08:15:05 +0000 (08:15 +0000)
committerChristopher R. Hertel <crh@samba.org>
Tue, 23 Jun 1998 08:15:05 +0000 (08:15 +0000)
pointer to the newly constructed name list entry.  In most cases, this
return value is ignored.  The two exceptions are in asyncdns.c and
nmbd_winsproxy.c.

Most of the calls which ignored the return value were not cast to void, so
I added the cast.  This helped me sort out which calls really did use the
return value.  I also discovered one case, in nmbd_winsserver.c, in which
the return value was being stored to a variable which, in turn, was not
used.

Chris -)-----
(This used to be commit 384122d165ed6d5d211a29e5a63a63bf5cd82c75)

source3/nmbd/nmbd_become_lmb.c
source3/nmbd/nmbd_lmhosts.c
source3/nmbd/nmbd_namelistdb.c
source3/nmbd/nmbd_nameregister.c
source3/nmbd/nmbd_winsproxy.c
source3/nmbd/nmbd_winsserver.c

index b97da7d8b4ee4aa54d5fa346d40bcdec26827e86..7329de6f69d0eceac252efd14fc32620e15b6b1f 100644 (file)
@@ -43,8 +43,9 @@ void insert_permanent_name_into_unicast( struct subnet_record *subrec,
   if((namerec = find_name_on_subnet(unicast_subnet, nmbname, FIND_SELF_NAME)) == NULL)
   {
     /* The name needs to be created on the unicast subnet. */
-    add_name_to_subnet( unicast_subnet, nmbname->name, nmbname->name_type,
-                        nb_type, PERMANENT_TTL, PERMANENT_NAME, 1, &subrec->myip);
+    (void)add_name_to_subnet( unicast_subnet, nmbname->name,
+                              nmbname->name_type, nb_type,
+                              PERMANENT_TTL, PERMANENT_NAME, 1, &subrec->myip);
   }
   else
   {
index f4d520b1cfc61674b8070e9a28b27c4c044c73da..158988813b7f918461cac5f54ac63888ffa80cb7 100644 (file)
@@ -64,13 +64,13 @@ void load_lmhosts_file(char *fname)
     if(name_type == -1)
     {
       /* Add the (0) and (0x20) names directly into the namelist for this subnet. */
-      add_name_to_subnet(subrec,name,0x00,(uint16)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);
-      add_name_to_subnet(subrec,name,0x20,(uint16)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);
+      (void)add_name_to_subnet(subrec,name,0x00,(uint16)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);
+      (void)add_name_to_subnet(subrec,name,0x20,(uint16)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);
     }
     else
     {
       /* Add the given name type to the subnet namelist. */
-      add_name_to_subnet(subrec,name,name_type,(uint16)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);
+      (void)add_name_to_subnet(subrec,name,name_type,(uint16)NB_ACTIVE,PERMANENT_TTL,source,1,&ipaddr);
     }
   }
    
index 4454cdfed064a2b7241d2542f13f7103cf32e0ac..d2c9ea2e71a440be5112ad1172d4be56f3e734aa 100644 (file)
@@ -280,8 +280,8 @@ void standard_success_register(struct subnet_record *subrec,
 
   namerec = find_name_on_subnet( subrec, nmbname, FIND_SELF_NAME );
   if( NULL == namerec )
-    add_name_to_subnet( subrec, nmbname->name, nmbname->name_type,
-                        nb_flags, ttl, SELF_NAME, 1, &registered_ip );
+    (void)add_name_to_subnet( subrec, nmbname->name, nmbname->name_type,
+                              nb_flags, ttl, SELF_NAME, 1, &registered_ip );
   else
     update_name_ttl( namerec, ttl );
 }
index a4b8d4d65ac5e605e5b09be7bcb8cab7b03c47a0..270a3ef6a5bc4cac0f6cdd1c527b649a8928a3d3 100644 (file)
@@ -277,11 +277,14 @@ static BOOL multihomed_register_name( struct nmb_name *nmbname, uint16 nb_flags,
     return True;
   }
 
-  for(subrec = FIRST_SUBNET, i = 0; subrec; subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec), i++ )
+  for( subrec = FIRST_SUBNET, i = 0; 
+       subrec;
+       subrec = NEXT_SUBNET_EXCLUDING_UNICAST(subrec), i++ )
     ip_list[i] = subrec->myip;
 
-  add_name_to_subnet(unicast_subnet, nmbname->name, nmbname->name_type, 
-                     nb_flags, lp_max_ttl(), SELF_NAME, num_ips, ip_list);
+  (void)add_name_to_subnet( unicast_subnet, nmbname->name, nmbname->name_type,
+                            nb_flags, lp_max_ttl(), SELF_NAME,
+                            num_ips, ip_list);
 
   /* Now try and register the name, num_ips times. On the last time use
      the given success and fail functions. */
index 97caef7f82a5312db191195fd962c40aee23f7fd..5635124bcda9637173ad1b5af22a86c571cc1e1b 100644 (file)
@@ -78,8 +78,9 @@ returned for name %s.\n", namestr(nmbname) ));
   if(rrec == PERMANENT_TTL)
     ttl = lp_max_ttl();
 
-  namerec = add_name_to_subnet( orig_broadcast_subnet, nmbname->name, nmbname->name_type,
-                         nb_flags, ttl, WINS_PROXY_NAME, num_ips, iplist);
+  namerec = add_name_to_subnet( orig_broadcast_subnet, nmbname->name,
+                                nmbname->name_type, nb_flags, ttl,
+                                WINS_PROXY_NAME, num_ips, iplist );
 
   if(iplist != &ip)
     free((char *)iplist);
index 304e9f4dba6ba492fd4c7577cca8a3d5ba0bdda9..e8dd78f1abe4ef2510ca1983c6c57876aed9279c 100644 (file)
@@ -268,16 +268,14 @@ BOOL initialise_wins(void)
     /* add all entries that have 60 seconds or more to live */
     if ((ttl - 60) > time_now || ttl == PERMANENT_TTL)
     {
-      struct name_record *namerec;
-
       if(ttl != PERMANENT_TTL)
         ttl -= time_now;
     
-      DEBUG(4, ("initialise_wins: add name: %s#%02x ttl = %d first IP %s flags = %2x\n",
+      DEBUG( 4, ("initialise_wins: add name: %s#%02x ttl = %d first IP %s flags = %2x\n",
            name, type, ttl, inet_ntoa(ip_list[0]), nb_flags));
 
-      namerec = add_name_to_subnet(wins_server_subnet, name, type, nb_flags, 
-                                   ttl, REGISTER_NAME, num_ips, ip_list);
+      (void)add_name_to_subnet( wins_server_subnet, name, type, nb_flags, 
+                                    ttl, REGISTER_NAME, num_ips, ip_list );
 
     }
     else
@@ -834,8 +832,8 @@ is one of our (WINS server) names. Denying registration.\n", namestr(question) )
    * Name did not exist - add it.
    */
 
-  add_name_to_subnet(subrec, question->name, question->name_type,
-                     nb_flags, ttl, REGISTER_NAME, 1, &from_ip);
+  (void)add_name_to_subnet( subrec, question->name, question->name_type,
+                            nb_flags, ttl, REGISTER_NAME, 1, &from_ip );
 
   send_wins_name_registration_response(0, ttl, p);
 }
@@ -1123,8 +1121,8 @@ is one of our (WINS server) names. Denying registration.\n", namestr(question) )
    * Name did not exist - add it.
    */
 
-  add_name_to_subnet(subrec, question->name, question->name_type,
-                     nb_flags, ttl, REGISTER_NAME, 1, &from_ip);
+  (void)add_name_to_subnet( subrec, question->name, question->name_type,
+                            nb_flags, ttl, REGISTER_NAME, 1, &from_ip );
 
   send_wins_name_registration_response(0, ttl, p);
 }