]> git.sur5r.net Git - u-boot/commitdiff
Get rid of annoying/superfluous bad-checksum warning message
authorRemy Bohmer <linux@bohmer.net>
Tue, 3 Jun 2008 13:48:17 +0000 (15:48 +0200)
committerBen Warren <biggerbadderben@gmail.com>
Thu, 5 Jun 2008 06:51:26 +0000 (23:51 -0700)
U-boot can complain a lot about 'checksum bad' when it is attached to the network.
It is annoying for ordinary users who start to doubt the network connection
in general when they see messages like this.

This is caused by the routine NetCksumOk() which cannot handle IP-headers longer
than 20 bytes. Those packages can be ignored anyway by U-boot, so we trash them
now before checking the checksum.

Signed-off-by: Remy Bohmer <linux@bohmer.net>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
net/net.c

index 78128772fe5cda166ea74aa8ac95832d8d155b55..f55c7facf2783676ccd683e90fd45523e899e9f6 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -1407,6 +1407,10 @@ NetReceive(volatile uchar * inpkt, int len)
                if (ip->ip_off & htons(0x1fff)) { /* Can't deal w/ fragments */
                        return;
                }
+               /* can't deal with headers > 20 bytes */
+               if ((ip->ip_hl_v & 0x0f) > 0x05) {
+                       return;
+               }
                if (!NetCksumOk((uchar *)ip, IP_HDR_SIZE_NO_UDP / 2)) {
                        puts ("checksum bad\n");
                        return;