From: Florian Fainelli Date: Mon, 9 Apr 2007 08:30:06 +0000 (+0000) Subject: Fix airlink image generation tool X-Git-Tag: reboot~29468 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d7960b2e50380d6fd1f295d3a3a086676cd44fdf;p=oweals%2Fopenwrt.git Fix airlink image generation tool SVN-Revision: 6913 --- diff --git a/tools/firmware-utils/src/airlink.c b/tools/firmware-utils/src/airlink.c index c24a9e320b..657c971761 100644 --- a/tools/firmware-utils/src/airlink.c +++ b/tools/firmware-utils/src/airlink.c @@ -319,14 +319,10 @@ int main(int argc, char **argv) unsigned long sum2 = buf[-0x8] | ((u32)buf[-0x7] << 8) | ((u32)buf[-0x6] << 16) | ((u32)buf[-0x5] << 24); *((u32 *) & buf[-0x8]) = 0L; sum = crc32(buf - 0x4, len - 0x4); - sum = htonl(sum); printf("CRC32 sum2 - (%x, %x, %x)\n", sum, sum2, len - 0x4); lseek(fd, 0, SEEK_SET); - buf[-0x8] = sum & 0xff; - buf[-0x7] = (sum >> 8) & 0xff; - buf[-0x6] = (sum >> 16) & 0xff; - buf[-0x5] = (sum >> 24) & 0xff; + *((u32 *) & buf[-0x8]) = htonl(sum); write(fd, &buf[-0x8], 0x4); buf -= 8; }