Commit 5d0ff542 authored by Hannes Frederic Sowa's avatar Hannes Frederic Sowa Committed by Steffen Klassert

ipv6: xfrm: dereference inner ipv6 header if encapsulated

In xfrm6_local_error use inner_header if the packet was encapsulated.

Cc: Steffen Klassert <steffen.klassert@secunet.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
parent 3d483058
...@@ -59,10 +59,12 @@ static void xfrm6_local_rxpmtu(struct sk_buff *skb, u32 mtu) ...@@ -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) void xfrm6_local_error(struct sk_buff *skb, u32 mtu)
{ {
struct flowi6 fl6; struct flowi6 fl6;
const struct ipv6hdr *hdr;
struct sock *sk = skb->sk; struct sock *sk = skb->sk;
hdr = skb->encapsulation ? inner_ipv6_hdr(skb) : ipv6_hdr(skb);
fl6.fl6_dport = inet_sk(sk)->inet_dport; 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); ipv6_local_error(sk, EMSGSIZE, &fl6, mtu);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment