All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kazunori MIYAZAWA <kazunori@miyazawa.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@vger.kernel.org, usagi-core@linux-ipv6.org,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: [PATCH][IPv6][IPsec] fix the address family for xfrm_state_lookup in xfrm_input
Date: Tue, 04 Dec 2007 15:23:01 +0900	[thread overview]
Message-ID: <4754F245.1070602@miyazawa.org> (raw)
In-Reply-To: <20071204054935.GA1747@gondor.apana.org.au>

Herbert Xu wrote:
> On Tue, Dec 04, 2007 at 02:28:36PM +0900, Kazunori MIYAZAWA wrote:
>> Hi Herbert, 
>>
>> This is the patch to fix IPv6 IPsec input.
>>
>> Signed-off-by: Kazunori MIYAZAWA <kazunori@miyazawa.org>
> 
> Good catch! Thanks.
> 
>> diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
>> index 96f42c1..da3c963 100644
>> --- a/net/xfrm/xfrm_input.c
>> +++ b/net/xfrm/xfrm_input.c
>> @@ -136,7 +136,7 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type)
>>  		if (skb->sp->len == XFRM_MAX_DEPTH)
>>  			goto drop;
>>  
>> -		x = xfrm_state_lookup(daddr, spi, nexthdr, AF_INET);
>> +		x = xfrm_state_lookup(daddr, spi, nexthdr, skb->dst->ops->family);
> 
> I'd prefer to put this in XFRM_SPI_SKB_CB instead because the xfrm
> layer shouldn't really rely on dst->ops structures except on entry
> and exit, like this:
> 
> [IPSEC]: Use the correct family for input state lookup
> 
> When merging the input paths of IPsec I accidentally left a hard-coded
> AF_INET for the state lookup call.  This broke IPv6 obviously.  This
> patch fixes by getting the input callers to specify the family through
> skb->cb.
> 
> Credit goes to Kazunori Miyazawa for diagnosing this and providing an
> initial patch.
> 
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
> 
> Cheers,

It works fine.

Thank you!!

--
Kazunori Miyazawa

  reply	other threads:[~2007-12-04  6:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-04  5:28 [PATCH][IPv6][IPsec] fix the address family for xfrm_state_lookup in xfrm_input Kazunori MIYAZAWA
2007-12-04  5:49 ` Herbert Xu
2007-12-04  6:23   ` Kazunori MIYAZAWA [this message]
2007-12-04  6:54     ` David Miller

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=4754F245.1070602@miyazawa.org \
    --to=kazunori@miyazawa.org \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=usagi-core@linux-ipv6.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.