aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/xfrm.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 1dc4ff0f4851..158848f55640 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -992,12 +992,13 @@ static inline int __xfrm_policy_check2(struct sock *sk, int dir,
992 struct sk_buff *skb, 992 struct sk_buff *skb,
993 unsigned int family, int reverse) 993 unsigned int family, int reverse)
994{ 994{
995 struct net *net = dev_net(skb->dev);
995 int ndir = dir | (reverse ? XFRM_POLICY_MASK + 1 : 0); 996 int ndir = dir | (reverse ? XFRM_POLICY_MASK + 1 : 0);
996 997
997 if (sk && sk->sk_policy[XFRM_POLICY_IN]) 998 if (sk && sk->sk_policy[XFRM_POLICY_IN])
998 return __xfrm_policy_check(sk, ndir, skb, family); 999 return __xfrm_policy_check(sk, ndir, skb, family);
999 1000
1000 return (!init_net.xfrm.policy_count[dir] && !skb->sp) || 1001 return (!net->xfrm.policy_count[dir] && !skb->sp) ||
1001 (skb->dst->flags & DST_NOPOLICY) || 1002 (skb->dst->flags & DST_NOPOLICY) ||
1002 __xfrm_policy_check(sk, ndir, skb, family); 1003 __xfrm_policy_check(sk, ndir, skb, family);
1003} 1004}