aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@gmail.com>2008-11-25 20:35:44 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-25 20:35:44 -0500
commitf6e1e25d703c0a9ba1863384a16851dec52f8e3a (patch)
treecd89a1a4f3d4f6c54448d922347f4054ea6e04a0 /include
parent52479b623d3d41df84c499325b6a8c7915413032 (diff)
netns xfrm: xfrm_policy_check in netns
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-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}