Fix endian bug in SDR add from file reported in Tracker Bug #2075258

This commit is contained in:
Carol Hebert 2009-01-31 01:10:18 +00:00
parent 1d927c8c45
commit 2579bbe542
2 changed files with 2 additions and 2 deletions

View File

@ -4073,7 +4073,7 @@ ipmi_sdr_dump_bin(struct ipmi_intf *intf, const char *ofile)
uint8_t h[5];
/* build and write sdr header */
h[0] = sdrr->id & 0xff;
h[0] = sdrr->id & 0xff; // LS Byte first
h[1] = (sdrr->id >> 8) & 0xff;
h[2] = sdrr->version;
h[3] = sdrr->type;

View File

@ -352,7 +352,7 @@ ipmi_sdr_read_records(const char *filename, struct sdrr_queue *queue)
rc = -1;
break;
}
sdrr->id = (binHdr[0] << 8) | binHdr[1];
sdrr->id = (binHdr[1] << 8) | binHdr[0]; // LS Byte first
sdrr->version = binHdr[2];
sdrr->type = binHdr[3];
sdrr->length = binHdr[4];