aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <florian@openwrt.org>2007-04-09 08:30:06 +0000
committerFlorian Fainelli <florian@openwrt.org>2007-04-09 08:30:06 +0000
commit7a2d3e8ee2e6e185902117d7d1115a7a3616ecce (patch)
treea8c3a1f03ed208eab589304fd8435984b89337f7
parent0bc4e83ed061225aa93a748f96216d6ab300c944 (diff)
downloadupstream-7a2d3e8ee2e6e185902117d7d1115a7a3616ecce.tar.gz
upstream-7a2d3e8ee2e6e185902117d7d1115a7a3616ecce.tar.bz2
upstream-7a2d3e8ee2e6e185902117d7d1115a7a3616ecce.zip
Fix airlink image generation tool
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6913 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--tools/firmware-utils/src/airlink.c6
1 files changed, 1 insertions, 5 deletions
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;
}