public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated
@ 2013-08-17 17:51 Hannes Frederic Sowa
  2013-08-17 19:03 ` Eric Dumazet
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-17 17:51 UTC (permalink / raw)
  To: netdev; +Cc: steffen.klassert

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);
 }
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated
  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
  2013-08-17 19:53   ` Hannes Frederic Sowa
  0 siblings, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2013-08-17 19:03 UTC (permalink / raw)
  To: Hannes Frederic Sowa; +Cc: netdev, steffen.klassert

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>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH ipsec 2/3] ipv6: xfrm: dereference inner ipv6 header if encapsulated
  2013-08-17 19:03 ` Eric Dumazet
@ 2013-08-17 19:53   ` Hannes Frederic Sowa
  0 siblings, 0 replies; 3+ messages in thread
From: Hannes Frederic Sowa @ 2013-08-17 19:53 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev, steffen.klassert

On Sat, Aug 17, 2013 at 12:03:54PM -0700, Eric Dumazet wrote:
> 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 :

Thanks for the review, Eric!

I do think such details matter, so I'll respin this series by tomorrow.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-08-17 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2013-08-17 19:53   ` Hannes Frederic Sowa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox