xfrm: use secpath_exist where applicable
authorFlorian Westphal <fw@strlen.de>
Tue, 18 Dec 2018 16:15:24 +0000 (17:15 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 19 Dec 2018 19:21:37 +0000 (11:21 -0800)
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>
include/net/xfrm.h
net/xfrm/xfrm_interface.c

index af723448c972b97d343f270db578a8a24bfcd1a4..31220edcce952aed4c547f02df8f78efbe4b6ae4 100644 (file)
@@ -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);
 }
index d679fa0f44b31a99a2552ee7083ac1cb22d09908..6be8c7df15bb20f5a641a6922110b63f80652dca 100644 (file)
@@ -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);