giveupallcallbacks-locking-20071121
[openafs.git] / src / viced / afsfileprocs.c
index bdbd142..e8bed09 100644 (file)
@@ -47,14 +47,7 @@ RCSID
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
-
-#ifdef HAVE_STRING_H
 #include <string.h>
-#else
-#ifdef HAVE_STRINGS_H
-#include <strings.h>
-#endif
-#endif
 
 #ifndef AFS_LINUX20_ENV
 #include <net/if.h>
@@ -5988,7 +5981,9 @@ common_GiveUpCallBacks(struct rx_call *acall, struct AFSCBFids *FidArray,
                 (tcon->peer ? tcon->peer->host : 0)));
        errorCode = GetClient(tcon, &client);
        if (!errorCode) {
+           H_LOCK;
            DeleteAllCallBacks_r(client->host, 1);
+           H_UNLOCK;
            PutClient(&client);
        }
     } else {
@@ -7458,11 +7453,9 @@ SRXAFS_CallBackRxConnAddr (struct rx_call * acall, afs_int32 *addr)
     if ( !thost->interface ) 
        goto Bad_CallBackRxConnAddr;
     
-    assert(thost->interface->numberOfInterfaces > 0 );
-    
     /* the only address is the primary interface */
     /* can't change when there's only 1 address, anyway */
-    if ( thost->interface->numberOfInterfaces == 1 ) 
+    if ( thost->interface->numberOfInterfaces <= 1 ) 
        goto Bad_CallBackRxConnAddr;
     
     /* initialise a security object only once */