fix shadow variable in compute_ip_checksum.c
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4036 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
d469cdab93
commit
45dffef232
@ -16,13 +16,13 @@ unsigned long compute_ip_checksum(void *addr, unsigned long length)
|
|||||||
sum = 0;
|
sum = 0;
|
||||||
ptr = addr;
|
ptr = addr;
|
||||||
for(i = 0; i < length; i++) {
|
for(i = 0; i < length; i++) {
|
||||||
unsigned long value;
|
unsigned long v;
|
||||||
value = ptr[i];
|
v = ptr[i];
|
||||||
if (i & 1) {
|
if (i & 1) {
|
||||||
value <<= 8;
|
v <<= 8;
|
||||||
}
|
}
|
||||||
/* Add the new value */
|
/* Add the new value */
|
||||||
sum += value;
|
sum += v;
|
||||||
/* Wrap around the carry */
|
/* Wrap around the carry */
|
||||||
if (sum > 0xFFFF) {
|
if (sum > 0xFFFF) {
|
||||||
sum = (sum + (sum >> 16)) & 0xFFFF;
|
sum = (sum + (sum >> 16)) & 0xFFFF;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user