Skip to content

Commit

Permalink
ipv6: exthdrs: Reload hdr only when needed in ipv6_srh_rcv().
Browse files Browse the repository at this point in the history
We need not reload hdr in ipv6_srh_rcv() unless we call
pskb_expand_head().

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 0d2e27b commit b83d50f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/ipv6/exthdrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,9 +440,9 @@ static int ipv6_srh_rcv(struct sk_buff *skb)
kfree_skb(skb);
return -1;
}
}

hdr = (struct ipv6_sr_hdr *)skb_transport_header(skb);
hdr = (struct ipv6_sr_hdr *)skb_transport_header(skb);
}

hdr->segments_left--;
addr = hdr->segments + hdr->segments_left;
Expand Down

0 comments on commit b83d50f

Please sign in to comment.