mirror of
https://github.com/torvalds/linux.git
synced 2026-09-25 21:21:09 -04:00
ipv6: xfrm: dereference inner ipv6 header if encapsulated
In xfrm6_local_error use inner_header if the packet was encapsulated. Cc: Steffen Klassert <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: Hannes Frederic Sowa <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
This commit is contained in:
committed by
Steffen Klassert
parent
3d483058c8
commit
5d0ff542d0
@@ -59,10 +59,12 @@ static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu)
|
||||
void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
|
||||
{
|
||||
struct flowi6 fl6;
|
||||
const struct ipv6hdr *hdr;
|
||||
struct sock *sk = skb->sk;
|
||||
|
||||
hdr = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);
|
||||
fl6.fl6_dport = inet_sk(sk)->inet_dport;
|
||||
fl6.daddr = ipv6_hdr(skb)->daddr;
|
||||
fl6.daddr = hdr->daddr;
|
||||
|
||||
ipv6_local_error(sk, EMSGSIZE, &fl6, mtu);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user