Skip to content

Commit

Permalink
xfrm: use secpath_exist where applicable
Browse files Browse the repository at this point in the history
Will reduce noise when skb->sp is removed later in this series.

Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Westphal authored and David S. Miller committed Dec 19, 2018
1 parent 56d1ac3 commit 26912e3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion include/net/xfrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ static inline int __xfrm_policy_check2(struct sock *sk, int dir,
if (sk && sk->sk_policy[XFRM_POLICY_IN])
return __xfrm_policy_check(sk, ndir, skb, family);

return (!net->xfrm.policy_count[dir] && !skb->sp) ||
return (!net->xfrm.policy_count[dir] && !secpath_exists(skb)) ||
(skb_dst(skb)->flags & DST_NOPOLICY) ||
__xfrm_policy_check(sk, ndir, skb, family);
}
Expand Down
2 changes: 1 addition & 1 deletion net/xfrm/xfrm_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static int xfrmi_rcv_cb(struct sk_buff *skb, int err)
struct xfrm_if *xi;
bool xnet;

if (err && !skb->sp)
if (err && !secpath_exists(skb))
return 0;

x = xfrm_input_state(skb);
Expand Down

0 comments on commit 26912e3

Please sign in to comment.