Netdev List
 help / color / mirror / Atom feed
From: Jacek Kalwas <jacek.kalwas@intel.com>
To: davem@davemloft.net
Cc: Jacek Kalwas <jacek.kalwas@intel.com>,
	netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org
Subject: [net] xfrm: allow to release xfrm_state with flush
Date: Thu, 12 Apr 2018 12:03:14 -0700	[thread overview]
Message-ID: <20180412190315.3102-2-jacek.kalwas@intel.com> (raw)
In-Reply-To: <20180412190315.3102-1-jacek.kalwas@intel.com>

Call to flush SAs doesn't release xfrm_state in case there was a
traffic associated with that state and state was already deleted.

Given patch calls xfrm_policy_cache_flush despite of actual states
deleted in xfrm_state_flush function.

Signed-off-by: Jacek Kalwas <jacek.kalwas@intel.com>
---
 net/xfrm/xfrm_state.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index f9d2f2233f09..7d3d6a12a14f 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -734,10 +734,10 @@ int xfrm_state_flush(struct net *net, u8 proto, bool task_valid)
 	}
 out:
 	spin_unlock_bh(&net->xfrm.xfrm_state_lock);
-	if (cnt) {
+	if (cnt)
 		err = 0;
-		xfrm_policy_cache_flush();
-	}
+
+	xfrm_policy_cache_flush();
 	return err;
 }
 EXPORT_SYMBOL(xfrm_state_flush);
-- 
2.14.3

--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.

  reply	other threads:[~2018-04-12 19:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-12 19:03 [net] udp: enable UDP checksum offload for ESP Jacek Kalwas
2018-04-12 19:03 ` Jacek Kalwas [this message]
2018-04-19  6:56   ` [net] xfrm: allow to release xfrm_state with flush Steffen Klassert
2018-04-12 19:03 ` [net] xfrm: cover crypto status in xfrm_input Jacek Kalwas
2018-04-13 11:09   ` Steffen Klassert
2018-04-19  6:54 ` [net] udp: enable UDP checksum offload for ESP Steffen Klassert

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=20180412190315.3102-2-jacek.kalwas@intel.com \
    --to=jacek.kalwas@intel.com \
    --cc=davem@davemloft.net \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=netdev@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox