netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugene Surovegin <ebs@ebshome.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: netdev@oss.sgi.com
Subject: Re: [IPSEC] add missing flow_cache_genid update to xfrm_policy_delete()
Date: Thu, 5 Aug 2004 09:01:44 -0700	[thread overview]
Message-ID: <20040805160144.GA28597@gate.ebshome.net> (raw)
In-Reply-To: <E1BsgwG-0000O6-00@gondolin.me.apana.org.au>

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<ebs@ebshome.net>

===== 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)

  reply	other threads:[~2004-08-05 16:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-05  7:14 [IPSEC] add missing flow_cache_genid update to xfrm_policy_delete() Eugene Surovegin
2004-08-05 12:01 ` Herbert Xu
2004-08-05 16:01   ` Eugene Surovegin [this message]
2004-08-05 21:24     ` Herbert Xu
2004-08-09 23:51       ` David S. 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=20040805160144.GA28597@gate.ebshome.net \
    --to=ebs@ebshome.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@oss.sgi.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).