All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Gillott <mgillott@vyatta.att-mail.com>
To: netdev@vger.kernel.org
Cc: steffen.klassert@secunet.com, herbert@gondor.apana.org.au,
	Mark Gillott <mgillott@vyatta.att-mail.com>
Subject: [PATCH ipsec] xfrm: check DST_NOPOLICY as well as DST_NOXFRM
Date: Wed,  4 Dec 2019 15:17:14 +0000	[thread overview]
Message-ID: <20191204151714.20975-1-mgillott@vyatta.att-mail.com> (raw)

Before performing a policy bundle lookup, check the DST_NOPOLICY
option, as well as DST_NOXFRM. That is, skip further processing if
either of the disable_policy or disable_xfrm sysctl attributes are
set.

Signed-off-by: Mark Gillott <mgillott@vyatta.att-mail.com>
---
 net/xfrm/xfrm_policy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index f2d1e573ea55..a84df1da54d1 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -3075,7 +3075,7 @@ struct dst_entry *xfrm_lookup_with_ifid(struct net *net,
 		xflo.flags = flags;
 
 		/* To accelerate a bit...  */
-		if ((dst_orig->flags & DST_NOXFRM) ||
+		if ((dst_orig->flags & (DST_NOXFRM | DST_NOPOLICY)) ||
 		    !net->xfrm.policy_count[XFRM_POLICY_OUT])
 			goto nopol;
 
-- 
2.17.1


             reply	other threads:[~2019-12-04 15:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 15:17 Mark Gillott [this message]
2019-12-04 16:57 ` [PATCH ipsec] xfrm: check DST_NOPOLICY as well as DST_NOXFRM Nicolas Dichtel
2019-12-05  8:10   ` Mark Gillott
2019-12-05  8:52     ` Nicolas Dichtel
2019-12-05 10:05       ` Mark Gillott
2019-12-05 10:51         ` Nicolas Dichtel
2019-12-05 11:11           ` Mark Gillott

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=20191204151714.20975-1-mgillott@vyatta.att-mail.com \
    --to=mgillott@vyatta.att-mail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=steffen.klassert@secunet.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.