[coreboot] r3512 - in trunk/payloads/libpayload: include libc

svn at coreboot.org svn at coreboot.org
Sat Aug 16 17:16:36 CEST 2008


Author: stepan
Date: 2008-08-16 17:16:36 +0200 (Sat, 16 Aug 2008)
New Revision: 3512

Modified:
   trunk/payloads/libpayload/include/libpayload.h
   trunk/payloads/libpayload/libc/ipchecksum.c
Log:
trivial fix: ipchksum takes an unspecified input blob, not explicitly a number of shorts.
Signed-off-by: Stefan Reinauer <stepan at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>



Modified: trunk/payloads/libpayload/include/libpayload.h
===================================================================
--- trunk/payloads/libpayload/include/libpayload.h	2008-08-15 09:46:55 UTC (rev 3511)
+++ trunk/payloads/libpayload/include/libpayload.h	2008-08-16 15:16:36 UTC (rev 3512)
@@ -151,7 +151,7 @@
 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);

Modified: trunk/payloads/libpayload/libc/ipchecksum.c
===================================================================
--- trunk/payloads/libpayload/libc/ipchecksum.c	2008-08-15 09:46:55 UTC (rev 3511)
+++ trunk/payloads/libpayload/libc/ipchecksum.c	2008-08-16 15:16:36 UTC (rev 3512)
@@ -4,6 +4,7 @@
  * It has originally been taken from the FreeBSD project.
  *
  * Copyright (c) 2001 Charles Mott <cm at linktel.net>
+ * Copyright (c) 2008 coresystems GmbH
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -30,9 +31,10 @@
 
 #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) {





More information about the coreboot mailing list