vldb_check -fix is corrupting the server entries (Number, Partition,
Flags). This is because it is doing a htonl on what is a char field.
The read code already has a comment "make sure not to ntohl these,
as they're chars, not ints".
This change strips the corresponding htonl from writeheader (and puts
in a similar comment).
Change-Id: I5902be0f1e928521bfcb5ec66edd227c08ea2bdc
Reviewed-on: http://gerrit.openafs.org/1964
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
vlentryp->nextIdHash[i] = htonl(vlentryp->nextIdHash[i]);
vlentryp->nextNameHash = htonl(vlentryp->nextNameHash);
for (i = 0; i < NMAXNSERVERS; i++) {
- vlentryp->serverNumber[i] = htonl(vlentryp->serverNumber[i]);
- vlentryp->serverPartition[i] = htonl(vlentryp->serverPartition[i]);
- vlentryp->serverFlags[i] = htonl(vlentryp->serverFlags[i]);
+ /* make sure not to htonl 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] ;
}
vldbwrite(addr, (char *)vlentryp, sizeof(*vlentryp));
}