]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
Fix byteorder problem in usbboot and scsiboot commands.
authorwdenk <wdenk>
Fri, 4 Feb 2005 15:38:08 +0000 (15:38 +0000)
committerwdenk <wdenk>
Fri, 4 Feb 2005 15:38:08 +0000 (15:38 +0000)
CHANGELOG
common/cmd_scsi.c
common/cmd_usb.c

index e3f71e23c6f233be49cfbc2c214f9361138f911e..dc1423eb153b9add91073ddff6e1a4cdc400bfa5 100644 (file)
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -2,6 +2,8 @@
 Changes for U-Boot 1.1.3:
 ======================================================================
 
+* Fix byteorder problem in usbboot and scsiboot commands.
+
 * Patch by Cajus Hahn, 04 Feb 2005:
   - don't insist on leading '/' for filename in ext2load
   - set default partition to useful value (1) in ext2load
index 062b1c9cb337255930a77252956e0be76ce05790..61309f90a44837291fee6fad406892d486f7e6a8 100644 (file)
@@ -269,7 +269,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        hdr = (image_header_t *)addr;
 
-       if (hdr->ih_magic == IH_MAGIC) {
+       if (ntohl(hdr->ih_magic) == IH_MAGIC) {
                printf("\n** Bad Magic Number **\n");
                return 1;
        }
@@ -283,7 +283,7 @@ int do_scsiboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
        }
 
        print_image_hdr (hdr);
-       cnt = (hdr->ih_size + sizeof(image_header_t));
+       cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
        cnt += info.blksz - 1;
        cnt /= info.blksz;
        cnt -= 1;
index 3227db99d0064a9834e63d58f966800fbdaa3b7d..c6b5d140acad9cd46f0c497e69ab182504dc3e0a 100644 (file)
@@ -387,7 +387,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        hdr = (image_header_t *)addr;
 
-       if (hdr->ih_magic != IH_MAGIC) {
+       if (ntohl(hdr->ih_magic) != IH_MAGIC) {
                printf("\n** Bad Magic Number **\n");
                return 1;
        }
@@ -402,7 +402,7 @@ int do_usbboot (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
 
        print_image_hdr (hdr);
 
-       cnt = (hdr->ih_size + sizeof(image_header_t));
+       cnt = (ntohl(hdr->ih_size) + sizeof(image_header_t));
        cnt += info.blksz - 1;
        cnt /= info.blksz;
        cnt -= 1;