diff options
author | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-01-06 18:35:10 +0000 |
---|---|---|
committer | Marcus Glocker <mglocker@cvs.openbsd.org> | 2007-01-06 18:35:10 +0000 |
commit | 95cb0e13f48c6c53b845b74657f6e93592f69f82 (patch) | |
tree | fab44a5206ae50af642ea12c9b1d8f2e28dce595 /sys | |
parent | 218ec3adfe3d8eb8a5a3b7209350326f88937b2a (diff) |
Make the driver able to read the network byte ordered firmware file.
ok deraadt@ (also for the last dev/microcode/bcw import).
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/bcw.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/ic/bcw.c b/sys/dev/ic/bcw.c index 9cdad458262..5511ef2fd4a 100644 --- a/sys/dev/ic/bcw.c +++ b/sys/dev/ic/bcw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bcw.c,v 1.31 2007/01/05 12:52:30 mglocker Exp $ */ +/* $OpenBSD: bcw.c,v 1.32 2007/01/06 18:35:09 mglocker Exp $ */ /* * Copyright (c) 2006 Jon Simola <jsimola@gmail.com> @@ -2263,6 +2263,7 @@ bcw_get_firmware(const char *name, const uint8_t *ucode, size_t size_ucode, /* get number of firmware files */ bcopy(ucode, &nfiles, sizeof(nfiles)); + nfiles = ntohl(nfiles); off += sizeof(nfiles); /* parse header and search the firmware */ @@ -2273,8 +2274,8 @@ bcw_get_firmware(const char *name, const uint8_t *ucode, size_t size_ucode, if (strcmp(name, h->filename) == 0) { ret = 0; - *size = h->filesize; - *offset = h->fileoffset; + *size = ntohl(h->filesize); + *offset = ntohl(h->fileoffset); break; } } |