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 <[EMAIL PROTECTED]>

---
 net/net.c |    4 ++++
 1 file changed, 4 insertions(+)

Index: u-boot-git-03062008/net/net.c
===================================================================
--- u-boot-git-03062008.orig/net/net.c  2008-06-03 14:40:20.000000000 +0200
+++ u-boot-git-03062008/net/net.c       2008-06-03 15:46:21.000000000 +0200
@@ -1407,6 +1407,10 @@ NetReceive(volatile uchar * inpkt, int l
                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;

-- 



-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
U-Boot-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/u-boot-users

Reply via email to