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

Showing the changes to include (1 of 1 file). Show all

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
1162{1162{
1163 struct net *net = dev_net(skb->dev);1163 struct net *net = dev_net(skb->dev);
1164 1164
1165 if (xfrm_default_allow(net, XFRM_POLICY_FWD))1165 if (xfrm_default_allow(net, XFRM_POLICY_OUT))
1166 return !net->xfrm.policy_count[XFRM_POLICY_OUT] ||1166 return !net->xfrm.policy_count[XFRM_POLICY_OUT] ||
1167 (skb_dst(skb)->flags & DST_NOXFRM) ||1167 (skb_dst(skb)->flags & DST_NOXFRM) ||
1168 __xfrm_route_forward(skb, family);1168 __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