From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eugene Surovegin Subject: Re: [IPSEC] add missing flow_cache_genid update to xfrm_policy_delete() Date: Thu, 5 Aug 2004 09:01:44 -0700 Sender: netdev-bounce@oss.sgi.com Message-ID: <20040805160144.GA28597@gate.ebshome.net> References: <20040805071459.GA31551@gate.ebshome.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: netdev@oss.sgi.com Return-path: To: Herbert Xu Content-Disposition: inline In-Reply-To: Errors-to: netdev-bounce@oss.sgi.com List-Id: netdev.vger.kernel.org On Thu, Aug 05, 2004 at 10:01:40PM +1000, Herbert Xu wrote: > Please add a dir < XFRM_POLICY_MAX check before the atomic_inc so that > dying sockets with policies don't blow away the flow cache. Ohh, you're right :). Updated patch follows. Signed-off-by: Eugene Surovegin ===== net/xfrm/xfrm_policy.c 1.52 vs edited ===== --- 1.52/net/xfrm/xfrm_policy.c 2004-07-23 13:23:33 -07:00 +++ edited/net/xfrm/xfrm_policy.c 2004-08-05 08:58:22 -07:00 @@ -536,8 +536,11 @@ write_lock_bh(&xfrm_policy_lock); pol = __xfrm_policy_unlink(pol, dir); write_unlock_bh(&xfrm_policy_lock); - if (pol) + if (pol){ + if (dir < XFRM_POLICY_MAX) + atomic_inc(&flow_cache_genid); xfrm_policy_kill(pol); + } } int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol)