History

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().

Nicolas Dichtel committed 4 years ago

Commit ec3bb891 parent bcf141b1 file · +1 −1Browse files

Unified · Split

include/net/xfrm.h+1−1
@@ -1162,7 +1162,7 @@ static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family) · 1161 unmodified lines
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);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t