aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/xfrm.h4
-rw-r--r--net/xfrm/xfrm_policy.c3
2 files changed, 5 insertions, 2 deletions
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 158848f55640..36c8cffdf4e2 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -1050,7 +1050,9 @@ extern int __xfrm_route_forward(struct sk_buff *skb, unsigned short family);
1050 1050
1051static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family) 1051static inline int xfrm_route_forward(struct sk_buff *skb, unsigned short family)
1052{ 1052{
1053 return !init_net.xfrm.policy_count[XFRM_POLICY_OUT] || 1053 struct net *net = dev_net(skb->dev);
1054
1055 return !net->xfrm.policy_count[XFRM_POLICY_OUT] ||
1054 (skb->dst->flags & DST_NOXFRM) || 1056 (skb->dst->flags & DST_NOXFRM) ||
1055 __xfrm_route_forward(skb, family); 1057 __xfrm_route_forward(skb, family);
1056} 1058}
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 8097c9958cfc..54b50a20804f 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -2044,6 +2044,7 @@ EXPORT_SYMBOL(__xfrm_policy_check);
2044 2044
2045int __xfrm_route_forward(struct sk_buff *skb, unsigned short family) 2045int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
2046{ 2046{
2047 struct net *net = dev_net(skb->dev);
2047 struct flowi fl; 2048 struct flowi fl;
2048 2049
2049 if (xfrm_decode_session(skb, &fl, family) < 0) { 2050 if (xfrm_decode_session(skb, &fl, family) < 0) {
@@ -2052,7 +2053,7 @@ int __xfrm_route_forward(struct sk_buff *skb, unsigned short family)
2052 return 0; 2053 return 0;
2053 } 2054 }
2054 2055
2055 return xfrm_lookup(&init_net, &skb->dst, &fl, NULL, 0) == 0; 2056 return xfrm_lookup(net, &skb->dst, &fl, NULL, 0) == 0;
2056} 2057}
2057EXPORT_SYMBOL(__xfrm_route_forward); 2058EXPORT_SYMBOL(__xfrm_route_forward);
2058 2059