diff options
author | Remy Bohmer <linux@bohmer.net> | 2008-06-03 15:48:17 +0200 |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2008-06-04 23:51:26 -0700 |
commit | 6b52cfe16cd539935e32bd8cf19146522e462a4d (patch) | |
tree | c32c7381b606745a9c6250a2457341055c041883 /net/net.c | |
parent | d6ee5fa40c26970d39990c6fc4a2f20a97822650 (diff) | |
download | u-boot-imx-6b52cfe16cd539935e32bd8cf19146522e462a4d.zip u-boot-imx-6b52cfe16cd539935e32bd8cf19146522e462a4d.tar.gz u-boot-imx-6b52cfe16cd539935e32bd8cf19146522e462a4d.tar.bz2 |
Get rid of annoying/superfluous bad-checksum warning message
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>
Diffstat (limited to 'net/net.c')
-rw-r--r-- | net/net.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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; |