Skip to content

Commit

Permalink
ipv6: exthdrs: Replace pskb_pull() with skb_pull() in ipv6_srh_rcv().
Browse files Browse the repository at this point in the history
ipv6_rthdr_rcv() pulls these data

  - Segment Routing Header : 8
  - Hdr Ext Len            : skb_transport_header(skb)[1] << 3

needed by ipv6_srh_rcv(), so pskb_pull() in ipv6_srh_rcv() never
fails and can be replaced with skb_pull().

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 6facbca commit 0d2e27b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,11 +402,7 @@ static int ipv6_srh_rcv(struct sk_buff *skb)

skb_postpull_rcsum(skb, skb_network_header(skb),
skb_network_header_len(skb));

if (!pskb_pull(skb, offset)) {
kfree_skb(skb);
return -1;
}
skb_pull(skb, offset);
skb_postpull_rcsum(skb, skb_transport_header(skb),
offset);

Expand Down

0 comments on commit 0d2e27b

Please sign in to comment.