Skip to contentSkip to conversation

IP forwarded checksum, kernel 2.2.18-19

PATCH In review Martin Gadbois 2 participants 2 messages Apr 18, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IP forwarded checksum, kernel 2.2.18-19

Hi there!
I realized that some tests were failing due to dropped IP packets. I traced and discovered the following:

--------Begin patch
# This caused some "holes" in forwarded transfers, that is checksum was bad

# on some occasions -MG
diff -ur original/include/net/ip.h mpc8xx-2.2.18/include/net/ip.h
--- original/include/net/ip.h   Tue Apr 17 09:36:28 2001
+++ linux-2.2.18/include/net/ip.h      Tue Apr 17 16:30:16 2001
@@ -170,7 +170,7 @@
 extern __inline__
 int ip_decrease_ttl(struct iphdr *iph)
 {
-       u16 check = iph->check;
+       u32 check = iph->check;
        check += __constant_htons(0x0100);
        iph->check = check + (check>=0xFFFF);
        return --iph->ttl;
------------End patch

The expression check>=0xFFFF could only be true(1) when (u16)check == 0xFFFF, not what is it meant to be.
This is fixed exactly like this patch in 2.4.x.
Kernel 2.2.19 also has the same problems.

Thanks,

--
Martin Gadbois
S/W designer
Colubris Networks (http://www.colubris.com)

#1 lore raw
Quoted 3 lines · Martin Gadbois

Hi there!
I realized that some tests were failing due to dropped IP packets. I traced and discovered the following:

Thanks, I've put your patch into my 2.2.x source and will push this to Alan once he starts doing 2.2.20pre patches.

Later,
David S. Miller
[email protected]