ddf: get endian-ness of CRC correct.

All numeric fields in a DDF header big-endian, including the CRC, so
better fix that.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown 2008-10-27 10:04:46 +11:00
parent 0febf9a94d
commit 4abe6b7086
1 changed files with 4 additions and 1 deletions

View File

@ -446,7 +446,10 @@ static int calc_crc(void *buf, int len)
newcrc = crc32(0, buf, len);
ddf->crc = oldcrc;
return newcrc;
/* The crc is store (like everything) bigendian, so convert
* here for simplicity
*/
return __cpu_to_be32(newcrc);
}
static int load_ddf_header(int fd, unsigned long long lba,