aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorHannes Frederic Sowa <hannes@stressinduktion.org>2013-08-18 13:46:57 +0200
committerSteffen Klassert <steffen.klassert@secunet.com>2013-08-19 09:38:25 +0200
commit5d0ff542d0264f61dc4bdb34eba39ffb4ea3bc23 (patch)
tree766ded9ff8a4b6a5efaf148d82d6f355ea284884 /net/ipv6
parentipv6: wire up skb->encapsulation (diff)
downloadlinux-dev-5d0ff542d0264f61dc4bdb34eba39ffb4ea3bc23.tar.xz
linux-dev-5d0ff542d0264f61dc4bdb34eba39ffb4ea3bc23.zip
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: Eric Dumazet <edumazet@google.com> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/xfrm6_output.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
index 3ac5ab264fed..e092e306882d 100644
--- a/net/ipv6/xfrm6_output.c
+++ b/net/ipv6/xfrm6_output.c
@@ -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);
}