Skip to content

Commit

Permalink
ipv6: exthdrs: Remove redundant skb_headlen() check in ip6_parse_tlv().
Browse files Browse the repository at this point in the history
ipv6_destopt_rcv() and ipv6_parse_hopopts() pulls these data

  - Hop-by-Hop/Destination Options Header : 8
  - Hdr Ext Len                           : skb_transport_header(skb)[1] << 3

and calls ip6_parse_tlv(), so it need not check if skb_headlen() is less
than skb_transport_offset(skb) + (skb_transport_header(skb)[1] << 3).

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Kuniyuki Iwashima authored and Jakub Kicinski committed Jun 19, 2023
1 parent b83d50f commit 6db5dd2
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ static bool ip6_parse_tlv(bool hopbyhop,
max_count = -max_count;
}

if (skb_transport_offset(skb) + len > skb_headlen(skb))
goto bad;

off += 2;
len -= 2;

Expand Down

0 comments on commit 6db5dd2

Please sign in to comment.