[U-Boot] [PATCH v2 2/2] net: Add additional IP fragmentation check

Peter Tyser ptyser at xes-inc.com
Mon Dec 1 23:26:21 CET 2008


Ignore IP packets which have the "more fragments" flag bit
set.  This flag indicates the IP packet is fragmented and
must be ignored by U-Boot.

Signed-off-by: Peter Tyser <ptyser at xes-inc.com>
---
 net/net.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/net.c b/net/net.c
index cf1f4fa..b8e09e8 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1399,7 +1399,8 @@ NetReceive(volatile uchar * inpkt, int len)
 		if ((ip->ip_hl_v & 0xf0) != 0x40) {
 			return;
 		}
-		if (ip->ip_off & htons(IP_OFFS)) { /* Can't deal w/ fragments */
+		/* Can't deal with fragments */
+		if (ip->ip_off & htons(IP_OFFS | IP_FLAGS_MFRAG)) {
 			return;
 		}
 		/* can't deal with headers > 20 bytes */
-- 
1.6.0.2.GIT



More information about the U-Boot mailing list