From: Eric Dumazet <eric.dumazet@gmail.com>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: netdev@vger.kernel.org, steffen.klassert@secunet.com
Subject: Re: [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated
Date: Sat, 17 Aug 2013 12:03:54 -0700 [thread overview]
Message-ID: <1376766234.21329.11.camel@edumazet-glaptop> (raw)
In-Reply-To: <20130817175130.GA7039@order.stressinduktion.org>
On Sat, 2013-08-17 at 19:51 +0200, Hannes Frederic Sowa wrote:
> In xfrm6_local_error use inner_header if the packet was encapsulated.
>
> Cc: Steffen Klassert <steffen.klassert@secunet.com>
> Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
> ---
>
> This patch is based on Steffen Klassert's ipsec tree.
>
> net/ipv6/xfrm6_output.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c
> index 3ac5ab2..45effcc 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;
> + 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);
> }
You could have use "const struct ipv6hdr *hdr;", but otherwise :
Acked-by: Eric Dumazet <edumazet@google.com>
next prev parent reply other threads:[~2013-08-17 19:03 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-17 17:51 [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated Hannes Frederic Sowa
2013-08-17 19:03 ` Eric Dumazet [this message]
2013-08-17 19:53 ` Hannes Frederic Sowa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1376766234.21329.11.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=netdev@vger.kernel.org \
--cc=steffen.klassert@secunet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox