trivial fix: ipchksum takes an unspecified input blob, not explicitly a number of...
authorStefan Reinauer <stepan@coresystems.de>
Sat, 16 Aug 2008 15:16:36 +0000 (15:16 +0000)
committerStefan Reinauer <stepan@openbios.org>
Sat, 16 Aug 2008 15:16:36 +0000 (15:16 +0000)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@3512 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

payloads/libpayload/include/libpayload.h
payloads/libpayload/libc/ipchecksum.c

index 6f07ffa4a473b93668604ed46d9bc86d921bf61f..e75d5da5fdcc3e4c9b28647b583f835ea0a68b88 100644 (file)
@@ -151,7 +151,7 @@ int tolower(int c);
 int toupper(int c);
 
 /* libc/ipchecksum.c */
-unsigned short ipchksum(const unsigned short *ptr, unsigned long nbytes);
+unsigned short ipchksum(const void *ptr, unsigned long nbytes);
 
 /* libc/malloc.c */
 void free(void *ptr);
index f430c965a5f55acbfedb9d3f0bb33ca1a61ea30f..8d67921b0378e6f6a80fd4a5b44f6f683ed49829 100644 (file)
@@ -4,6 +4,7 @@
  * It has originally been taken from the FreeBSD project.
  *
  * Copyright (c) 2001 Charles Mott <cm@linktel.net>
+ * Copyright (c) 2008 coresystems GmbH
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 
 #include <libpayload.h>
 
-unsigned short ipchksum(const unsigned short *ptr, unsigned long nbytes)
+unsigned short ipchksum(const void *vptr, unsigned long nbytes)
 {
        int sum, oddbyte;
+       const unsigned short *ptr = vptr;
 
        sum = 0;
        while (nbytes > 1) {