Received: with ECARTIS (v1.0.0; list netdev); Mon, 28 Mar 2005 15:40:18 -0800 (PST) Received: from arnor.apana.org.au (mail@arnor.apana.org.au [203.14.152.115]) by oss.sgi.com (8.13.0/8.13.0) with ESMTP id j2SNe94v015580 for ; Mon, 28 Mar 2005 15:40:09 -0800 Received: from gondolin.me.apana.org.au ([192.168.0.6] ident=mail) by arnor.apana.org.au with esmtp (Exim 3.35 #1 (Debian)) id 1DG3pR-0007pl-00; Tue, 29 Mar 2005 09:39:29 +1000 Received: from herbert by gondolin.me.apana.org.au with local (Exim 3.36 #1 (Debian)) id 1DG3pG-000416-00; Tue, 29 Mar 2005 09:39:18 +1000 Date: Tue, 29 Mar 2005 09:39:17 +1000 To: Patrick McHardy Cc: "David S. Miller" , Alexey Kuznetsov , James Morris , YOSHIFUJI Hideaki , netdev@oss.sgi.com Subject: Checking SPI in xfrm_state_find Message-ID: <20050328233917.GB15369@gondor.apana.org.au> References: <20050214221006.GA18415@gondor.apana.org.au> <20050214221200.GA18465@gondor.apana.org.au> <20050214221433.GB18465@gondor.apana.org.au> <20050214221607.GC18465@gondor.apana.org.au> <424864CE.5060802@trash.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <424864CE.5060802@trash.net> User-Agent: Mutt/1.5.6+20040907i From: Herbert Xu X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 896 X-ecartis-version: Ecartis v1.0.0 Sender: netdev-bounce@oss.sgi.com Errors-to: netdev-bounce@oss.sgi.com X-original-sender: herbert@gondor.apana.org.au Precedence: bulk X-list: netdev Content-Length: 920 Lines: 22 On Mon, Mar 28, 2005 at 10:10:54PM +0200, Patrick McHardy wrote: > > Something unrelated I was also wondering about, from xfrm_find_state(): > > list_for_each_entry(x, xfrm_state_bydst+h, bydst) { > if (x->props.family == family && > x->props.reqid == tmpl->reqid && > xfrm_state_addr_check(x, daddr, saddr, family) && > tmpl->mode == x->props.mode && > tmpl->id.proto == x->id.proto) { > > Shouldn't we check for (tmpl->id.spi == x->id.spi || !tmpl->id.spi) ? Absolutely. We should also fix the larval state generation in that same function to fail the operation if that SPI already exists. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt