From: Andrew Deason Date: Tue, 9 Mar 2010 17:43:42 +0000 (-0600) Subject: vldb_check: do not ntohl u_chars X-Git-Tag: openafs-devel-1_5_73~70 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=97b69af9255d2aca0f858588cc957c05690e387e;p=packages%2Fo%2Fopenafs.git vldb_check: do not ntohl u_chars 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 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/vlserver/vldb_check.c b/src/vlserver/vldb_check.c index e37cf66f0..5eb1ed927 100644 --- a/src/vlserver/vldb_check.c +++ b/src/vlserver/vldb_check.c @@ -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) {