Skip to content

Commit ec3bb89

Browse files
NicolasDichtelklassert
authored andcommitted
xfrm: fix dflt policy check when there is no policy configured
When there is no policy configured on the system, the default policy is checked in xfrm_route_forward. However, it was done with the wrong direction (XFRM_POLICY_FWD instead of XFRM_POLICY_OUT). The default policy for XFRM_POLICY_FWD was checked just before, with a call to xfrm[46]_policy_check(). CC: [email protected] Fixes: 2d151d3 ("xfrm: Add possibility to set the default to block if we have no policy") Signed-off-by: Nicolas Dichtel <[email protected]> Signed-off-by: Steffen Klassert <[email protected]>
1 parent bcf141b commit ec3bb89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/net/xfrm.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family)
11621162
{
11631163
struct net *net = dev_net(skb->dev);
11641164

1165-
if (xfrm_default_allow(net, XFRM_POLICY_FWD))
1165+
if (xfrm_default_allow(net, XFRM_POLICY_OUT))
11661166
return !net->xfrm.policy_count[XFRM_POLICY_OUT] ||
11671167
(skb_dst(skb)->flags & DST_NOXFRM) ||
11681168
__xfrm_route_forward(skb, family);

0 commit comments

Comments
 (0)