netdev
[Top] [All Lists]

[IPSEC] Remove redundant check in xfrm_state_add()

To: "David S. Miller" <davem@xxxxxxxxxx>, netdev@xxxxxxxxxxx
Subject: [IPSEC] Remove redundant check in xfrm_state_add()
From: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 30 Jul 2004 22:10:56 +1000
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: Mutt/1.5.6+20040523i
Hi Dave:

This is the patch referred to in the netlink_get_spi thread.

I was actually wrong about the reason for this patch though.  Firstly
it's the SPI check that is redundant and not the find_acq() call.
And it's redundant because of the find_acq() patch, not because
of the fact that this is in xfrm_state_add().

Now that find_acq() only returns SAs with SPIs, we don't need to
check this in xfrm_state_add() anymore.

We do still need the call though to clean up leftover larval states.

Another side-effect of the change is that we can move the existence
check above find_acq() since find_acq() will never return any SAs
matching the SPI we're trying to add (It doesn't need to because if
an SA with a matching SPI existed, it would've been returned by
state_lookup() already).

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Attachment: p
Description: Text document

<Prev in Thread] Current Thread [Next in Thread>