death to trailing whitespace
[openafs.git] / src / viced / host.c
index 4c7cacf..604b3ab 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright 2000, International Business Machines Corporation and others.
  * All Rights Reserved.
- * 
+ *
  * This software has been released under the terms of the IBM Public
  * License.  For details, see the LICENSE file in the top-level source
  * directory or online at http://www.openafs.org/dl/license10.html
@@ -278,14 +278,14 @@ hpr_Initialize(struct ubik_client **uclient)
        ViceLog(0, ("hpr_Initialize: Could not open configuration directory: %s", AFSDIR_SERVER_ETC_DIRPATH));
        return -1;
     }
-    
+
     code = afsconf_GetLocalCell(tdir, cellstr, sizeof(cellstr));
     if (code) {
        ViceLog(0, ("hpr_Initialize: Could not get local cell. [%d]", code));
        afsconf_Close(tdir);
        return code;
     }
-    
+
     code = afsconf_GetCellInfo(tdir, cellstr, "afsprot", &info);
     if (code) {
        ViceLog(0, ("hpr_Initialize: Could not locate cell %s in %s/%s",
@@ -293,14 +293,14 @@ hpr_Initialize(struct ubik_client **uclient)
        afsconf_Close(tdir);
        return code;
     }
-    
+
     code = rx_Init(0);
     if (code) {
        ViceLog(0, ("hpr_Initialize: Could not initialize rx."));
        afsconf_Close(tdir);
         return code;
     }
-    
+
     /* Most callers use secLevel==1, however, the fileserver uses secLevel==2
      * to force use of the KeyFile.  secLevel == 0 implies -noauth was
      * specified. */
@@ -317,7 +317,7 @@ hpr_Initialize(struct ubik_client **uclient)
         sc = rxnull_NewClientSecurityObject();
     if (scIndex == RX_SECIDX_NULL)
        ViceLog(0, ("hpr_Initialize: Could not get afs tokens, running unauthenticated. [%d]", code));
-    
+
     memset(serverconns, 0, sizeof(serverconns));        /* terminate list!!! */
     for (i = 0; i < info.numServers; i++) {
         serverconns[i] =
@@ -352,12 +352,12 @@ hpr_GetHostCPS(afs_int32 host, prlist *CPS)
 #ifdef AFS_PTHREAD_ENV
     afs_int32 code;
     afs_int32 over;
-    struct ubik_client *uclient = 
+    struct ubik_client *uclient =
        (struct ubik_client *)pthread_getspecific(viced_uclient_key);
 
     if (!uclient) {
         code = hpr_Initialize(&uclient);
-       if (!code) 
+       if (!code)
            assert(pthread_setspecific(viced_uclient_key, (void *)uclient) == 0);
        else
            return code;
@@ -386,7 +386,7 @@ hpr_NameToId(namelist *names, idlist *ids)
 #ifdef AFS_PTHREAD_ENV
     afs_int32 code;
     afs_int32 i;
-    struct ubik_client *uclient = 
+    struct ubik_client *uclient =
        (struct ubik_client *)pthread_getspecific(viced_uclient_key);
 
     if (!uclient) {
@@ -411,9 +411,9 @@ hpr_IdToName(idlist *ids, namelist *names)
 {
 #ifdef AFS_PTHREAD_ENV
     afs_int32 code;
-    struct ubik_client *uclient = 
+    struct ubik_client *uclient =
        (struct ubik_client *)pthread_getspecific(viced_uclient_key);
-    
+
     if (!uclient) {
         code = hpr_Initialize(&uclient);
        if (!code)
@@ -435,7 +435,7 @@ hpr_GetCPS(afs_int32 id, prlist *CPS)
 #ifdef AFS_PTHREAD_ENV
     afs_int32 code;
     afs_int32 over;
-    struct ubik_client *uclient = 
+    struct ubik_client *uclient =
        (struct ubik_client *)pthread_getspecific(viced_uclient_key);
 
     if (!uclient) {
@@ -618,16 +618,16 @@ h_gethostcps_r(struct host *host, afs_int32 now)
         * with one of these errors. In such case we would like to reevaluate the rpc call to
         * find if there's cps for this guy. We treat other errors (except network failures
         * ones - i.e. code < 0) as an indication that there is no CPS for this host. Ideally
-        * we could like to deal this problem the other way around (i.e. if code == NOCPS 
+        * we could like to deal this problem the other way around (i.e. if code == NOCPS
         * ignore else retry next time) but the problem is that there're other errors (i.e.
         * EPERM) for which we don't want to retry and we don't know the whole code list!
         */
        if (code < 0 || code == UNOQUORUM || code == UNOTSYNC) {
-           /* 
+           /*
             * We would have preferred to use a while loop and try again since ops in protected
             * acls for this host will fail now but they'll be reevaluated on any subsequent
             * call. The attempt to wait for a quorum/sync site or network error won't work
-            * since this problems really should only occurs during a complete fileserver 
+            * since this problems really should only occurs during a complete fileserver
             * restart. Since the fileserver will start before the ptservers (and thus before
             * quorums are complete) clients will be utilizing all the fileserver's lwps!!
             */
@@ -779,7 +779,7 @@ h_Lookup_r(afs_uint32 haddr, afs_uint16 hport, struct host **hostp)
        assert(host);
        if (!(host->hostFlags & HOSTDELETED) && chain->addr == haddr
            && chain->port == hport) {
-           if ((host->hostFlags & HWHO_INPROGRESS) && 
+           if ((host->hostFlags & HWHO_INPROGRESS) &&
                h_threadquota(host->lock.num_waiting)) {
                *hostp = 0;
                return VBUSY;
@@ -888,7 +888,7 @@ h_TossStuff_r(struct host *host)
                         ntohs(host->port), client));
                return;
            }
-                
+
            if (client->refCount) {
                char hoststr[16];
                ViceLog(0,
@@ -942,7 +942,7 @@ h_TossStuff_r(struct host *host)
            /* delete the hash entry for each valid alternate addresses */
            for (i = 0; i < host->interface->numberOfInterfaces; i++) {
                hostAddrPort = host->interface->interface[i];
-                /* 
+                /*
                  * if the interface addr/port is the primary, we already
                  * removed it.  If the addr/port is not valid, its not
                  * in the hash table.
@@ -1045,7 +1045,7 @@ h_Enumerate(int (*proc) (struct host*, int, void *), void *param)
  * be held after enumeration.
  */
 void
-h_Enumerate_r(int (*proc) (struct host *, int, void *), 
+h_Enumerate_r(int (*proc) (struct host *, int, void *),
              struct host *enumstart, void *param)
 {
     struct host *host, *next;
@@ -1137,15 +1137,15 @@ h_AddHostToUuidHashTable_r(struct afsUUID *uuid, struct host *host)
        if (!chain->hostPtr)
            continue;
 
-       if (chain->hostPtr->interface && 
+       if (chain->hostPtr->interface &&
            afs_uuid_equal(&chain->hostPtr->interface->uuid, uuid)) {
            if (LogLevel >= 125) {
-               afsUUID_to_string(&chain->hostPtr->interface->uuid, uuid1, 
+               afsUUID_to_string(&chain->hostPtr->interface->uuid, uuid1,
                                  127);
                afsUUID_to_string(uuid, uuid2, 127);
-               ViceLog(125, ("h_AddHostToUuidHashTable_r: host %" AFS_PTR_FMT " (uuid %s) exists as %s:%d (uuid %s)\n", 
+               ViceLog(125, ("h_AddHostToUuidHashTable_r: host %" AFS_PTR_FMT " (uuid %s) exists as %s:%d (uuid %s)\n",
                              host, uuid1,
-                             afs_inet_ntoa_r(chain->hostPtr->host, hoststr), 
+                             afs_inet_ntoa_r(chain->hostPtr->host, hoststr),
                              ntohs(chain->hostPtr->port), uuid2));
            }
            return;
@@ -1164,9 +1164,9 @@ h_AddHostToUuidHashTable_r(struct afsUUID *uuid, struct host *host)
          if (LogLevel < 125)
               return;
      afsUUID_to_string(uuid, uuid2, 127);
-     ViceLog(125, 
+     ViceLog(125,
             ("h_AddHostToUuidHashTable_r: host %p (%s:%d) added as uuid %s\n",
-             host, afs_inet_ntoa_r(chain->hostPtr->host, hoststr), 
+             host, afs_inet_ntoa_r(chain->hostPtr->host, hoststr),
              ntohs(chain->hostPtr->port), uuid2));
 }
 
@@ -1178,30 +1178,30 @@ h_DeleteHostFromUuidHashTable_r(struct host *host)
      struct h_UuidHashChain **uhp, *uth;
      char uuid1[128];
      char hoststr[16];
+
      if (!host->interface)
        return 0;
+
      /* hash into proper bucket */
      index = h_UuidHashIndex(&host->interface->uuid);
-     
+
      if (LogLevel >= 125)
         afsUUID_to_string(&host->interface->uuid, uuid1, 127);
      for (uhp = &hostUuidHashTable[index]; (uth = *uhp); uhp = &uth->next) {
          assert(uth->hostPtr);
         if (uth->hostPtr == host) {
-            ViceLog(125, 
+            ViceLog(125,
                     ("h_DeleteHostFromUuidHashTable_r: host %" AFS_PTR_FMT " (uuid %s %s:%d)\n",
-                     host, uuid1, afs_inet_ntoa_r(host->host, hoststr), 
+                     host, uuid1, afs_inet_ntoa_r(host->host, hoststr),
                      ntohs(host->port)));
             *uhp = uth->next;
             free(uth);
             return 1;
         }
      }
-     ViceLog(125, 
+     ViceLog(125,
             ("h_DeleteHostFromUuidHashTable_r: host %" AFS_PTR_FMT " (uuid %s %s:%d) not found\n",
-             host, uuid1, afs_inet_ntoa_r(host->host, hoststr), 
+             host, uuid1, afs_inet_ntoa_r(host->host, hoststr),
              ntohs(host->port)));
      return 0;
 }
@@ -1515,9 +1515,9 @@ h_AddHostToAddrHashTable_r(afs_uint32 addr, afs_uint16 port, struct host *host)
 }
 
 /*
- * This is called with host locked and held. 
+ * This is called with host locked and held.
  * It is called to either validate or add an additional interface
- * address/port on the specified host.  
+ * address/port on the specified host.
  *
  * All addresses are in network byte order.
  */
@@ -1528,7 +1528,7 @@ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     int number;
     struct Interface *interface;
     char hoststr[16], hoststr2[16];
-                                                   
+
     assert(host);
     assert(host->interface);
 
@@ -1540,13 +1540,13 @@ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     for (i = 0; i < number; i++) {
        if (host->interface->interface[i].addr == addr &&
              host->interface->interface[i].port == port) {
-           ViceLog(125, 
+           ViceLog(125,
                    ("addInterfaceAddr : found host %" AFS_PTR_FMT " (%s:%d) adding %s:%d%s\n",
-                    host, afs_inet_ntoa_r(host->host, hoststr), 
-                    ntohs(host->port), afs_inet_ntoa_r(addr, hoststr2), 
-                    ntohs(port), host->interface->interface[i].valid ? "" : 
+                    host, afs_inet_ntoa_r(host->host, hoststr),
+                    ntohs(host->port), afs_inet_ntoa_r(addr, hoststr2),
+                    ntohs(port), host->interface->interface[i].valid ? "" :
                     ", validating"));
-     
+
            if (host->interface->interface[i].valid == 0) {
                host->interface->interface[i].valid = 1;
                h_AddHostToAddrHashTable_r(addr, port, host);
@@ -1555,11 +1555,11 @@ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
         }
     }
 
-    ViceLog(125, ("addInterfaceAddr : host %" AFS_PTR_FMT " (%s:%d) adding %s:%d\n", 
-                 host, afs_inet_ntoa_r(host->host, hoststr), 
-                 ntohs(host->port), afs_inet_ntoa_r(addr, hoststr2), 
+    ViceLog(125, ("addInterfaceAddr : host %" AFS_PTR_FMT " (%s:%d) adding %s:%d\n",
+                 host, afs_inet_ntoa_r(host->host, hoststr),
+                 ntohs(host->port), afs_inet_ntoa_r(addr, hoststr2),
                  ntohs(port)));
-    
+
     interface = (struct Interface *)
        malloc(sizeof(struct Interface) + (sizeof(struct AddrPort) * number));
     if (!interface) {
@@ -1570,7 +1570,7 @@ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     interface->uuid = host->interface->uuid;
     for (i = 0; i < number; i++)
        interface->interface[i] = host->interface->interface[i];
-    
+
     /* Add the new valid interface */
     interface->interface[number].addr = addr;
     interface->interface[number].port = port;
@@ -1578,7 +1578,7 @@ addInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     h_AddHostToAddrHashTable_r(addr, port, host);
     free(host->interface);
     host->interface = interface;
-    
+
     return 0;
 }
 
@@ -1599,9 +1599,9 @@ removeInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
     assert(host);
     assert(host->interface);
 
-    ViceLog(125, ("removeInterfaceAddr : host %" AFS_PTR_FMT " (%s:%d) addr %s:%d\n", 
-                 host, afs_inet_ntoa_r(host->host, hoststr), 
-                 ntohs(host->port), afs_inet_ntoa_r(addr, hoststr2), 
+    ViceLog(125, ("removeInterfaceAddr : host %" AFS_PTR_FMT " (%s:%d) addr %s:%d\n",
+                 host, afs_inet_ntoa_r(host->host, hoststr),
+                 ntohs(host->port), afs_inet_ntoa_r(addr, hoststr2),
                  ntohs(port)));
 
     /*
@@ -1622,7 +1622,7 @@ removeInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
            interface->numberOfInterfaces = number;
            return 0;
        }
-    }  
+    }
     /* not found */
     return 0;
 }
@@ -1630,7 +1630,7 @@ removeInterfaceAddr_r(struct host *host, afs_uint32 addr, afs_uint16 port)
 
 
 static int
-h_threadquota(int waiting) 
+h_threadquota(int waiting)
 {
     if (lwps > 64) {
        if (waiting > 5)
@@ -1688,7 +1688,7 @@ h_GetHost_r(struct rx_connection *tcon)
         * structure for this address. Verify that the identity
         * of the caller matches the identity in the host structure.
         */
-       if ((host->hostFlags & HWHO_INPROGRESS) && 
+       if ((host->hostFlags & HWHO_INPROGRESS) &&
            h_threadquota(host->lock.num_waiting)) {
                h_Release_r(host);
            host = NULL;
@@ -1717,16 +1717,16 @@ h_GetHost_r(struct rx_connection *tcon)
          * If there is a match, we can use the existing callback
          * connection to verify the UUID.  If they do not match
          * we need to use a new callback connection to verify the
-         * UUID of the incoming caller and perhaps use the old 
+         * UUID of the incoming caller and perhaps use the old
          * callback connection to verify that the old address/port
          * is still valid.
          */
-       
+
        cb_conn = host->callback_rxcon;
        rx_GetConnection(cb_conn);
        H_UNLOCK;
         if (haddr == host->host && hport == host->port) {
-            /* The existing callback connection matches the 
+            /* The existing callback connection matches the
              * incoming connection so just use it.
              */
            code =
@@ -1743,7 +1743,7 @@ h_GetHost_r(struct rx_connection *tcon)
             cb_in = rx_NewConnection(haddr, hport, 1, sc, 0);
             rx_SetConnDeadTime(cb_in, 50);
             rx_SetConnHardDeadTime(cb_in, AFS_HARDDEADTIME);
-           
+
             code =
                 RXAFSCB_TellMeAboutYourself(cb_in, &interf, &caps);
            if (code == RXGEN_OPCODE)
@@ -1752,7 +1752,7 @@ h_GetHost_r(struct rx_connection *tcon)
        rx_PutConnection(cb_conn);
        cb_conn=NULL;
        H_LOCK;
-       if ((code == RXGEN_OPCODE) || 
+       if ((code == RXGEN_OPCODE) ||
            ((code == 0) && (afs_uuid_equal(&interf.uuid, &nulluuid)))) {
            identP = (struct Identity *)malloc(sizeof(struct Identity));
            if (!identP) {
@@ -1762,14 +1762,14 @@ h_GetHost_r(struct rx_connection *tcon)
            identP->valid = 0;
            rx_SetSpecific(tcon, rxcon_ident_key, identP);
            if (cb_in == NULL) {
-               /* The host on this connection was unable to respond to 
+               /* The host on this connection was unable to respond to
                 * the WhoAreYou. We will treat this as a new connection
                 * from the existing host. The worst that can happen is
                 * that we maintain some extra callback state information */
                if (host->interface) {
                    ViceLog(0,
                            ("Host %" AFS_PTR_FMT " (%s:%d) used to support WhoAreYou, deleting.\n",
-                            host, 
+                            host,
                             afs_inet_ntoa_r(host->host, hoststr),
                             ntohs(host->port)));
                    host->hostFlags |= HOSTDELETED;
@@ -1783,7 +1783,7 @@ h_GetHost_r(struct rx_connection *tcon)
                /* The incoming connection does not support WhoAreYou but
                 * the original one might have.  Use removeAddress_r() to
                  * remove this addr/port from the host that was found.
-                 * If there are no more addresses left for the host it 
+                 * If there are no more addresses left for the host it
                  * will be deleted.  Then we retry.
                  */
                 removeAddress_r(host, haddr, hport);
@@ -1818,7 +1818,7 @@ h_GetHost_r(struct rx_connection *tcon)
                    ViceLog(25,
                            ("Uuid doesn't match host %" AFS_PTR_FMT " (%s:%d).\n",
                             host, afs_inet_ntoa_r(host->host, hoststr), ntohs(host->port)));
-                   
+
                    removeAddress_r(host, host->host, host->port);
                }
                host->hostFlags &= ~HWHO_INPROGRESS;
@@ -1828,8 +1828,8 @@ h_GetHost_r(struct rx_connection *tcon)
                host = NULL;
                goto retry;
            } else if (cb_in) {
-               /* the UUID matched the client at the incoming addr/port 
-                 * but this is not the address of the active callback 
+               /* the UUID matched the client at the incoming addr/port
+                 * but this is not the address of the active callback
                  * connection.  Try that connection and see if the client
                  * is still there and if the reported UUID is the same.
                  */
@@ -1849,18 +1849,18 @@ h_GetHost_r(struct rx_connection *tcon)
                 if (code2) {
                     /* The primary address is either not responding or
                      * is not the client we are looking for.  Need to
-                     * remove the primary address and add swap in the new 
+                     * remove the primary address and add swap in the new
                      * callback connection, and destroy the old one.
                      */
                     struct rx_connection *rxconn;
                     ViceLog(0,("CB: ProbeUuid for host %" AFS_PTR_FMT " (%s:%d) failed %d\n",
-                              host, 
+                              host,
                               afs_inet_ntoa_r(host->host, hoststr),
                               ntohs(host->port),code2));
 
-                    /* 
+                    /*
                      * make sure we add and then remove.  otherwise, we
-                     * might end up with no valid interfaces after the 
+                     * might end up with no valid interfaces after the
                      * remove and the host will have been marked deleted.
                      */
                     addInterfaceAddr_r(host, haddr, hport);
@@ -1870,7 +1870,7 @@ h_GetHost_r(struct rx_connection *tcon)
                     rxconn = host->callback_rxcon;
                     host->callback_rxcon = cb_in;
                     cb_in = NULL;
-                   
+
                     if (rxconn) {
                         /*
                          * If rx_DestroyConnection calls h_FreeConnection we
@@ -1885,7 +1885,7 @@ h_GetHost_r(struct rx_connection *tcon)
            }
        } else {
             if (cb_in) {
-                /* A callback to the incoming connection address is failing.  
+                /* A callback to the incoming connection address is failing.
                  * Assume that the addr/port is no longer associated with the host
                  * returned by h_Lookup_r.
                  */
@@ -1978,7 +1978,7 @@ h_GetHost_r(struct rx_connection *tcon)
            rx_PutConnection(cb_conn);
            cb_conn=NULL;
            H_LOCK;
-           if ((code == RXGEN_OPCODE) || 
+           if ((code == RXGEN_OPCODE) ||
                ((code == 0) && (afs_uuid_equal(&interf.uuid, &nulluuid)))) {
                if (!identP)
                    identP =
@@ -2061,12 +2061,12 @@ h_GetHost_r(struct rx_connection *tcon)
                         cb_conn=NULL;
                        if (code2) {
                            /* The primary address is either not responding or
-                            * is not the client we are looking for.  
+                            * is not the client we are looking for.
                             * MultiProbeAlternateAddress_r() will remove the
                             * alternate interfaces that do not have the same
                             * Uuid. */
                            ViceLog(0,("CB: ProbeUuid for host %" AFS_PTR_FMT " (%s:%d) failed %d\n",
-                                        oldHost, 
+                                        oldHost,
                                          afs_inet_ntoa_r(oldHost->host, hoststr),
                                         ntohs(oldHost->port),code2));
                            MultiProbeAlternateAddress_r(oldHost);
@@ -2088,24 +2088,24 @@ h_GetHost_r(struct rx_connection *tcon)
 
                        ViceLog(25,
                                  ("CB: Host %" AFS_PTR_FMT " (%s:%d) has new addr %s:%d\n",
-                                   oldHost, 
+                                   oldHost,
                                    afs_inet_ntoa_r(oldHost->host, hoststr2),
                                    ntohs(oldHost->port),
                                    afs_inet_ntoa_r(haddr, hoststr),
                                    ntohs(hport)));
-                       /* 
+                       /*
                         * add then remove.  otherwise the host may get marked
                         * deleted if we removed the only valid address.
                         */
                        addInterfaceAddr_r(oldHost, haddr, hport);
                        if (probefail || oldHost->host == haddr) {
-                           /* 
-                            * The probe failed which means that the old 
-                            * address is either unreachable or is not the 
-                            * same host we were just contacted by.  We will 
-                            * also remove addresses if only the port has 
+                           /*
+                            * The probe failed which means that the old
+                            * address is either unreachable or is not the
+                            * same host we were just contacted by.  We will
+                            * also remove addresses if only the port has
                             * changed because that indicates the client
-                            * is behind a NAT. 
+                            * is behind a NAT.
                             */
                            removeInterfaceAddr_r(oldHost, oldHost->host, oldHost->port);
                        } else {
@@ -2115,12 +2115,12 @@ h_GetHost_r(struct rx_connection *tcon)
                            for (i = 0; i < number; i++) {
                                if (interface->interface[i].addr == haddr &&
                                    interface->interface[i].port != hport) {
-                                   /* 
+                                   /*
                                     * We have just been contacted by a client
-                                    * that has been seen from behind a NAT 
+                                    * that has been seen from behind a NAT
                                     * and at least one other address.
                                     */
-                                   removeInterfaceAddr_r(oldHost, haddr, 
+                                   removeInterfaceAddr_r(oldHost, haddr,
                                                          interface->interface[i].port);
                                    break;
                                }
@@ -2132,7 +2132,7 @@ h_GetHost_r(struct rx_connection *tcon)
                        rxconn = oldHost->callback_rxcon;
                        oldHost->callback_rxcon = host->callback_rxcon;
                        host->callback_rxcon = rxconn;
-                       
+
                         /* don't destroy rxconn here; let h_TossStuff_r
                          * take care of that via h_Release_r below */
                    }
@@ -2146,7 +2146,7 @@ h_GetHost_r(struct rx_connection *tcon)
                    /* This really is a new host */
                    h_AddHostToUuidHashTable_r(&identP->uuid, host);
                    cb_conn = host->callback_rxcon;
-                   rx_GetConnection(cb_conn);          
+                   rx_GetConnection(cb_conn);
                    H_UNLOCK;
                    code =
                        RXAFSCB_InitCallBackState3(cb_conn,
@@ -2375,13 +2375,13 @@ h_FindClient_r(struct rx_connection *tcon)
     int created = 0;
 
     client = (struct client *)rx_GetSpecific(tcon, rxcon_client_key);
-    if (client && client->sid == rxr_CidOf(tcon) 
+    if (client && client->sid == rxr_CidOf(tcon)
        && client->VenusEpoch == rxr_GetEpoch(tcon)
        && !(client->host->hostFlags & HOSTDELETED)) {
 
        client->refCount++;
        h_Hold_r(client->host);
-       if (!client->deleted && client->prfail != 2) {  
+       if (!client->deleted && client->prfail != 2) {
            /* Could add shared lock on client here */
            /* note that we don't have to lock entry in this path to
             * ensure CPS is initialized, since we don't call rx_SetSpecific
@@ -2408,7 +2408,7 @@ h_FindClient_r(struct rx_connection *tcon)
        expTime = 0x7fffffff;
     } else if (authClass == 2) {
        afs_int32 kvno;
-    
+
        /* kerberos ticket */
        code = rxkad_GetServerInfo(tcon, /*level */ 0, (afs_uint32 *)&expTime,
                                   tname, tinst, tcell, &kvno);
@@ -2448,7 +2448,7 @@ h_FindClient_r(struct rx_connection *tcon)
     if (!client) { /* loop */
        host = h_GetHost_r(tcon);       /* Returns with incremented refCount  */
 
-       if (!host) 
+       if (!host)
            return NULL;
 
     retryfirstclient:
@@ -2519,7 +2519,7 @@ h_FindClient_r(struct rx_connection *tcon)
                char hoststr[16];
                ViceLog(0,
                        ("pr_GetCPS failed(%d) for user %d, host %" AFS_PTR_FMT " (%s:%d)\n",
-                        code, viceid, client->host, 
+                        code, viceid, client->host,
                          afs_inet_ntoa_r(client->host->host,hoststr),
                         ntohs(client->host->port)));
 
@@ -2542,7 +2542,7 @@ h_FindClient_r(struct rx_connection *tcon)
        }
        /* the disabling of system:administrators is so iffy and has so many
         * possible failure modes that we will disable it again */
-       /* Turn off System:Administrator for safety  
+       /* Turn off System:Administrator for safety
         * if (AL_IsAMember(SystemId, client->CPS) == 0)
         * assert(AL_DisableGroup(SystemId, client->CPS) == 0); */
     }
@@ -2561,7 +2561,7 @@ h_FindClient_r(struct rx_connection *tcon)
            if (created) {
                ViceLog(0, ("FindClient: stillborn client %p(%x); "
                            "conn %p (host %s:%d) had client %p(%x)\n",
-                           client, client->sid, tcon, 
+                           client, client->sid, tcon,
                            afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
                            ntohs(rxr_PortOf(tcon)),
                            oldClient, oldClient->sid));
@@ -2576,7 +2576,7 @@ h_FindClient_r(struct rx_connection *tcon)
            if (created) {
                FreeCE(client);
                created = 0;
-           } 
+           }
            oldClient->refCount++;
            H_UNLOCK;
            ObtainWriteLock(&oldClient->lock);
@@ -2585,7 +2585,7 @@ h_FindClient_r(struct rx_connection *tcon)
        } else {
            ViceLog(0, ("FindClient: deleted client %p(%x) already had "
                        "conn %p (host %s:%d), stolen by client %p(%x)\n",
-                       oldClient, oldClient->sid, tcon, 
+                       oldClient, oldClient->sid, tcon,
                        afs_inet_ntoa_r(rxr_HostOf(tcon), hoststr),
                        ntohs(rxr_PortOf(tcon)),
                        client, client->sid));
@@ -2684,7 +2684,7 @@ GetClient(struct rx_connection *tcon, struct client **cp)
 int
 PutClient(struct client **cp)
 {
-    if (*cp == NULL) 
+    if (*cp == NULL)
        return -1;
 
     H_LOCK;
@@ -2828,7 +2828,7 @@ static int
 h_DumpHost(struct host *host, int flags, void *rock)
 {
     StreamHandle_t *file = (StreamHandle_t *)rock;
-    
+
     int i;
     char tmpStr[256];
     char hoststr[16];
@@ -2854,7 +2854,7 @@ h_DumpHost(struct host *host, int flags, void *rock)
     if (host->interface)
        for (i = 0; i < host->interface->numberOfInterfaces; i++) {
            char hoststr[16];
-           sprintf(tmpStr, " %s:%d", 
+           sprintf(tmpStr, " %s:%d",
                     afs_inet_ntoa_r(host->interface->interface[i].addr, hoststr),
                     ntohs(host->interface->interface[i].port));
            (void)STREAM_WRITE(tmpStr, strlen(tmpStr), 1, file);
@@ -2949,7 +2949,7 @@ h_stateSave(struct fs_dump_state * state)
 /* demand attach fs
  * host state serialization
  *
- * this procedure restores all host state from a disk for fast startup 
+ * this procedure restores all host state from a disk for fast startup
  */
 int
 h_stateRestore(struct fs_dump_state * state)
@@ -3025,7 +3025,7 @@ h_stateVerifyHost(struct host * h, int flags, void* rock)
 
     if (h->interface) {
        for (i = h->interface->numberOfInterfaces-1; i >= 0; i--) {
-           if (h_stateVerifyAddrHash(state, h, h->interface->interface[i].addr, 
+           if (h_stateVerifyAddrHash(state, h, h->interface->interface[i].addr,
                                      h->interface->interface[i].port,
                                      h->interface->interface[i].valid)) {
                state->bail = 1;
@@ -3150,7 +3150,7 @@ h_stateVerifyUuidHash(struct fs_dump_state * state, struct host * h)
        if (host->interface &&
            afs_uuid_equal(&host->interface->uuid, uuidp)) {
            if (host != h) {
-               ViceLog(0, ("h_stateVerifyUuidHash: warning: uuid hash entry points to different host struct (%d, %d)\n", 
+               ViceLog(0, ("h_stateVerifyUuidHash: warning: uuid hash entry points to different host struct (%d, %d)\n",
                            h->index, host->index));
                state->flags.warnings_generated = 1;
            }
@@ -3239,7 +3239,7 @@ h_stateSaveHost(struct host * host, int flags, void* rock)
 
     h_hostToDiskEntry_r(host, &hdsk);
     if (host->interface) {
-       if_len = sizeof(struct Interface) + 
+       if_len = sizeof(struct Interface) +
            ((host->interface->numberOfInterfaces-1) * sizeof(struct AddrPort));
        ifp = (struct Interface *) malloc(if_len);
        assert(ifp != NULL);
@@ -3263,7 +3263,7 @@ h_stateSaveHost(struct host * host, int flags, void* rock)
     if (hdsk.index > state->h_hdr->index_max)
        state->h_hdr->index_max = hdsk.index;
 
-    hdr.len = sizeof(struct host_state_entry_header) + 
+    hdr.len = sizeof(struct host_state_entry_header) +
        sizeof(struct hostDiskEntry) + if_len + hcps_len;
     hdr.magic = HOST_STATE_ENTRY_MAGIC;
 
@@ -3271,7 +3271,7 @@ h_stateSaveHost(struct host * host, int flags, void* rock)
     iov[0].iov_len = sizeof(hdr);
     iov[1].iov_base = (char *) &hdsk;
     iov[1].iov_len = sizeof(struct hostDiskEntry);
-    
+
     if (fs_stateWriteV(state, iov, iovcnt)) {
        ViceLog(0, ("h_stateSaveHost: failed to save host %d", host->index));
        state->bail = 1;
@@ -3375,11 +3375,11 @@ h_stateRestoreHost(struct fs_dump_state * state)
     if (ifp) {
        int i;
        for (i = ifp->numberOfInterfaces-1; i >= 0; i--) {
-            if (ifp->interface[i].valid && 
+            if (ifp->interface[i].valid &&
                 !(ifp->interface[i].addr == host->host &&
                   ifp->interface[i].port == host->port)) {
-                h_AddHostToAddrHashTable_r(ifp->interface[i].addr, 
-                                           ifp->interface[i].port, 
+                h_AddHostToAddrHashTable_r(ifp->interface[i].addr,
+                                           ifp->interface[i].port,
                                            host);
             }
        }
@@ -3751,7 +3751,7 @@ CheckHost(struct host *host, int flags, void *rock)
                    }
                    /* Note:  it's safe to delete hosts even if they have call
                     * back state, because break delayed callbacks (called when a
-                    * message is received from the workstation) will always send a 
+                    * message is received from the workstation) will always send a
                     * break all call backs to the workstation if there is no
                     * callback.
                     */
@@ -3778,7 +3778,7 @@ CheckHost(struct host *host, int flags, void *rock)
                        H_LOCK;
                        if (code) {
                            ViceLog(0,
-                                   ("CheckHost: Probe failed for host %s:%d, code %d\n", 
+                                   ("CheckHost: Probe failed for host %s:%d, code %d\n",
                                     hoststr, ntohs(host->port), code));
                            host->hostFlags |= VENUSDOWN;
                        }
@@ -3855,7 +3855,7 @@ CheckHost_r(struct host *host, int flags, void *dummy)
                    }
                    /* Note:  it's safe to delete hosts even if they have call
                     * back state, because break delayed callbacks (called when a
-                    * message is received from the workstation) will always send a 
+                    * message is received from the workstation) will always send a
                     * break all call backs to the workstation if there is no
                     * callback.
                     */
@@ -3882,7 +3882,7 @@ CheckHost_r(struct host *host, int flags, void *dummy)
                        H_LOCK;
                        if (code) {
                            ViceLog(0,
-                                   ("CheckHost_r: Probe failed for host %s:%d, code %d\n", 
+                                   ("CheckHost_r: Probe failed for host %s:%d, code %d\n",
                                     hoststr, ntohs(host->port), code));
                            host->hostFlags |= VENUSDOWN;
                        }
@@ -3922,7 +3922,7 @@ h_CheckHosts(void)
      */
     checktime = now - 15 * 60;
     clientdeletetime = now - 120 * 60; /* 2 hours ago */
-    
+
     H_LOCK;
     h_Enumerate_r(CheckHost_r, hostList, NULL);
     H_UNLOCK;
@@ -3956,7 +3956,7 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
     myPort = host->port;       /* current port */
 
     ViceLog(125,
-           ("initInterfaceAddr : host %s:%d numAddr %d\n", 
+           ("initInterfaceAddr : host %s:%d numAddr %d\n",
              afs_inet_ntoa_r(myAddr, hoststr), ntohs(myPort), number));
 
     /* validation checks */
@@ -3967,7 +3967,7 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
     }
 
     /*
-     * The client's notion of its own IP addresses is not reliable.  
+     * The client's notion of its own IP addresses is not reliable.
      *
      * 1. The client list might contain private address ranges which
      *    are likely to be re-used by many clients allocated addresses
@@ -3994,8 +3994,8 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
 
     /*
      * Convert IP addresses to network byte order, and remove
-     * duplicate IP addresses from the interface list, and 
-     * determine whether or not the incoming addr/port is 
+     * duplicate IP addresses from the interface list, and
+     * determine whether or not the incoming addr/port is
      * listed.  Note that if the address matches it is not
      * truly a match because the port number for the entries
      * in the interface list are port 7001 and the port number
@@ -4044,12 +4044,12 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
     for (i = 0; i < count; i++) {
 
         interface->interface[i].addr = interf->addr_in[i];
-       /* We store the port as 7001 because the addresses reported by 
+       /* We store the port as 7001 because the addresses reported by
         * TellMeAboutYourself and WhoAreYou RPCs are only valid if they
         * are coming from fully connected hosts (no NAT/PATs)
         */
        interface->interface[i].port = port7001;
-        interface->interface[i].valid = 
+        interface->interface[i].valid =
             (interf->addr_in[i] == myAddr && port7001 == myPort) ? 1 : 0;
     }
 
@@ -4060,10 +4060,10 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
 
     if (LogLevel >= 125) {
        afsUUID_to_string(&interface->uuid, uuidstr, 127);
-       
+
        ViceLog(125, ("--- uuid %s\n", uuidstr));
        for (i = 0; i < host->interface->numberOfInterfaces; i++) {
-           ViceLog(125, ("--- alt address %s:%d\n", 
+           ViceLog(125, ("--- alt address %s:%d\n",
                          afs_inet_ntoa_r(host->interface->interface[i].addr, hoststr),
                          ntohs(host->interface->interface[i].port)));
        }
@@ -4075,7 +4075,7 @@ initInterfaceAddr_r(struct host *host, struct interfaceAddr *interf)
 /* deleted a HashChain structure for this address and host */
 /* returns 1 on success */
 int
-h_DeleteHostFromAddrHashTable_r(afs_uint32 addr, afs_uint16 port, 
+h_DeleteHostFromAddrHashTable_r(afs_uint32 addr, afs_uint16 port,
                                struct host *host)
 {
     char hoststr[16];
@@ -4084,7 +4084,7 @@ h_DeleteHostFromAddrHashTable_r(afs_uint32 addr, afs_uint16 port,
     if (addr == 0 && port == 0)
        return 1;
 
-    for (hp = &hostAddrHashTable[h_HashIndex(addr)]; (th = *hp); 
+    for (hp = &hostAddrHashTable[h_HashIndex(addr)]; (th = *hp);
         hp = &th->next) {
         assert(th->hostPtr);
         if (th->hostPtr == host && th->addr == addr && th->port == port) {
@@ -4096,9 +4096,9 @@ h_DeleteHostFromAddrHashTable_r(afs_uint32 addr, afs_uint16 port,
            return 1;
         }
     }
-    ViceLog(125, 
+    ViceLog(125,
            ("h_DeleteHostFromAddrHashTable_r: host %" AFS_PTR_FMT " (%s:%d) not found\n",
-            host, afs_inet_ntoa_r(host->host, hoststr), 
+            host, afs_inet_ntoa_r(host->host, hoststr),
             ntohs(host->port)));
     return 0;
 }