diff options
author | Rasmus Villemoes <rasmus.villemoes@prevas.dk> | 2022-10-14 19:43:37 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-11-28 10:25:18 -0500 |
commit | b0fcc48cb37057ccbe29481d3297f7b9243a4b92 (patch) | |
tree | 8a2d0355d1bdea64b604cf0af897bdfc321ae281 /net | |
parent | e9d3fc7e46a81be3a9530713b4e75f4205961170 (diff) | |
download | u-boot-b0fcc48cb37057ccbe29481d3297f7b9243a4b92.zip u-boot-b0fcc48cb37057ccbe29481d3297f7b9243a4b92.tar.gz u-boot-b0fcc48cb37057ccbe29481d3297f7b9243a4b92.tar.bz2 |
net: improve check for no IP options
There's no reason we should accept an IP packet with a malformed IHL
field. So ensure that it is exactly 5, not just <= 5.
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reviewed-by: Ramon Fried <rfried.dev@gmail.com>
Diffstat (limited to 'net')
-rw-r--r-- | net/net.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1226,7 +1226,7 @@ void net_process_received_packet(uchar *in_packet, int len) if ((ip->ip_hl_v & 0xf0) != 0x40) return; /* Can't deal with IP options (headers != 20 bytes) */ - if ((ip->ip_hl_v & 0x0f) > 0x05) + if ((ip->ip_hl_v & 0x0f) != 0x05) return; /* Check the Checksum of the header */ if (!ip_checksum_ok((uchar *)ip, IP_HDR_SIZE)) { |