vldb_check: do not ntohl u_chars
authorAndrew Deason <adeason@sinenomine.net>
Tue, 9 Mar 2010 17:43:42 +0000 (11:43 -0600)
committerDerrick Brashear <shadow@dementia.org>
Tue, 9 Mar 2010 20:11:21 +0000 (12:11 -0800)
vldb_check was ntohl'ing fields like serverNumber when reading in a VL
entry. Since this is a u_char, ntohl'ing will just always result in 0,
not the actual value. Remove the ntohls so we read in VL data correctly.

FIXES 126661

Change-Id: If5117e1750d6dacd9bbe18bc936e0a1ba3d44340
Reviewed-on: http://gerrit.openafs.org/1548
Tested-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/vlserver/vldb_check.c

index e37cf66..5eb1ed9 100644 (file)
@@ -379,9 +379,10 @@ readentry(afs_int32 addr, struct nvlentry *vlentryp, afs_int32 *type)
        vlentryp->nextIdHash[i] = ntohl(vlentryp->nextIdHash[i]);
     vlentryp->nextNameHash = ntohl(vlentryp->nextNameHash);
     for (i = 0; i < NMAXNSERVERS; i++) {
-       vlentryp->serverNumber[i] = ntohl(vlentryp->serverNumber[i]);
-       vlentryp->serverPartition[i] = ntohl(vlentryp->serverPartition[i]);
-       vlentryp->serverFlags[i] = ntohl(vlentryp->serverFlags[i]);
+       /* make sure not to ntohl these, as they're chars, not ints */
+       vlentryp->serverNumber[i] = vlentryp->serverNumber[i];
+       vlentryp->serverPartition[i] = vlentryp->serverPartition[i];
+       vlentryp->serverFlags[i] = vlentryp->serverFlags[i];
     }
 
     if (vlentryp->flags == VLCONTBLOCK) {