aboutsummaryrefslogtreecommitdiffstats
path: root/net/xfrm/xfrm_policy.c
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 /net/xfrm/xfrm_policy.c
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 'net/xfrm/xfrm_policy.c')
-rw-r--r--net/xfrm/xfrm_policy.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 7c88a25c7af5..8097c9958cfc 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -1894,6 +1894,7 @@ static inline int secpath_has_nontransport(struct sec_path *sp, int k, int *idxp
1894int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb, 1894int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
1895 unsigned short family) 1895 unsigned short family)
1896{ 1896{
1897 struct net *net = dev_net(skb->dev);
1897 struct xfrm_policy *pol; 1898 struct xfrm_policy *pol;
1898 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX]; 1899 struct xfrm_policy *pols[XFRM_POLICY_TYPE_MAX];
1899 int npols = 0; 1900 int npols = 0;
@@ -1938,7 +1939,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
1938 } 1939 }
1939 1940
1940 if (!pol) 1941 if (!pol)
1941 pol = flow_cache_lookup(&init_net, &fl, family, fl_dir, 1942 pol = flow_cache_lookup(net, &fl, family, fl_dir,
1942 xfrm_policy_lookup); 1943 xfrm_policy_lookup);
1943 1944
1944 if (IS_ERR(pol)) { 1945 if (IS_ERR(pol)) {
@@ -1961,7 +1962,7 @@ int __xfrm_policy_check(struct sock *sk, int dir, struct sk_buff *skb,
1961 npols ++; 1962 npols ++;
1962#ifdef CONFIG_XFRM_SUB_POLICY 1963#ifdef CONFIG_XFRM_SUB_POLICY
1963 if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) { 1964 if (pols[0]->type != XFRM_POLICY_TYPE_MAIN) {
1964 pols[1] = xfrm_policy_lookup_bytype(&init_net, XFRM_POLICY_TYPE_MAIN, 1965 pols[1] = xfrm_policy_lookup_bytype(net, XFRM_POLICY_TYPE_MAIN,
1965 &fl, family, 1966 &fl, family,
1966 XFRM_POLICY_IN); 1967 XFRM_POLICY_IN);
1967 if (pols[1]) { 1968 if (pols[1]) {