All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH ipsec] xfrm: check DST_NOPOLICY as well as DST_NOXFRM
@ 2019-12-04 15:17 Mark Gillott
  2019-12-04 16:57 ` Nicolas Dichtel
  0 siblings, 1 reply; 7+ messages in thread
From: Mark Gillott @ 2019-12-04 15:17 UTC (permalink / raw)
  To: netdev; +Cc: steffen.klassert, herbert, Mark Gillott

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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-12-05 13:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-04 15:17 [PATCH ipsec] xfrm: check DST_NOPOLICY as well as DST_NOXFRM Mark Gillott
2019-12-04 16:57 ` 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

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.