diff options
author | Hans Schillstrom <hans.schillstrom@ericsson.com> | 2011-01-03 08:45:02 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2011-01-12 20:30:29 -0500 |
commit | 4a98480bccc2f5998c5564d254392635b9aa04c2 (patch) | |
tree | 5cffb8060f52da78bb64ef9c94cdd0c630d1dd0a | |
parent | 763f8d0ed4f1ce38b35cc0e05482b7799b82789b (diff) |
IPVS: netns, misc init_net removal in core.
init_net removed in __ip_vs_addr_is_local_v6, and got net as param.
Signed-off-by: Hans Schillstrom <hans.schillstrom@ericsson.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
-rw-r--r-- | net/netfilter/ipvs/ip_vs_core.c | 6 | ||||
-rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 9 |
2 files changed, 9 insertions, 6 deletions
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c index bdda346a4f30..9e10c7a0720a 100644 --- a/net/netfilter/ipvs/ip_vs_core.c +++ b/net/netfilter/ipvs/ip_vs_core.c | |||
@@ -499,6 +499,7 @@ ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | |||
499 | int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 499 | int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
500 | struct ip_vs_proto_data *pd) | 500 | struct ip_vs_proto_data *pd) |
501 | { | 501 | { |
502 | struct net *net; | ||
502 | struct netns_ipvs *ipvs; | 503 | struct netns_ipvs *ipvs; |
503 | __be16 _ports[2], *pptr; | 504 | __be16 _ports[2], *pptr; |
504 | struct ip_vs_iphdr iph; | 505 | struct ip_vs_iphdr iph; |
@@ -511,18 +512,19 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | |||
511 | ip_vs_service_put(svc); | 512 | ip_vs_service_put(svc); |
512 | return NF_DROP; | 513 | return NF_DROP; |
513 | } | 514 | } |
515 | net = skb_net(skb); | ||
514 | 516 | ||
515 | #ifdef CONFIG_IP_VS_IPV6 | 517 | #ifdef CONFIG_IP_VS_IPV6 |
516 | if (svc->af == AF_INET6) | 518 | if (svc->af == AF_INET6) |
517 | unicast = ipv6_addr_type(&iph.daddr.in6) & IPV6_ADDR_UNICAST; | 519 | unicast = ipv6_addr_type(&iph.daddr.in6) & IPV6_ADDR_UNICAST; |
518 | else | 520 | else |
519 | #endif | 521 | #endif |
520 | unicast = (inet_addr_type(&init_net, iph.daddr.ip) == RTN_UNICAST); | 522 | unicast = (inet_addr_type(net, iph.daddr.ip) == RTN_UNICAST); |
521 | 523 | ||
522 | /* if it is fwmark-based service, the cache_bypass sysctl is up | 524 | /* if it is fwmark-based service, the cache_bypass sysctl is up |
523 | and the destination is a non-local unicast, then create | 525 | and the destination is a non-local unicast, then create |
524 | a cache_bypass connection entry */ | 526 | a cache_bypass connection entry */ |
525 | ipvs = net_ipvs(skb_net(skb)); | 527 | ipvs = net_ipvs(net); |
526 | if (ipvs->sysctl_cache_bypass && svc->fwmark && unicast) { | 528 | if (ipvs->sysctl_cache_bypass && svc->fwmark && unicast) { |
527 | int ret, cs; | 529 | int ret, cs; |
528 | struct ip_vs_conn *cp; | 530 | struct ip_vs_conn *cp; |
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c index 65f5de405ad2..edf2b6dee972 100644 --- a/net/netfilter/ipvs/ip_vs_ctl.c +++ b/net/netfilter/ipvs/ip_vs_ctl.c | |||
@@ -71,7 +71,8 @@ int ip_vs_get_debug_level(void) | |||
71 | 71 | ||
72 | #ifdef CONFIG_IP_VS_IPV6 | 72 | #ifdef CONFIG_IP_VS_IPV6 |
73 | /* Taken from rt6_fill_node() in net/ipv6/route.c, is there a better way? */ | 73 | /* Taken from rt6_fill_node() in net/ipv6/route.c, is there a better way? */ |
74 | static int __ip_vs_addr_is_local_v6(const struct in6_addr *addr) | 74 | static int __ip_vs_addr_is_local_v6(struct net *net, |
75 | const struct in6_addr *addr) | ||
75 | { | 76 | { |
76 | struct rt6_info *rt; | 77 | struct rt6_info *rt; |
77 | struct flowi fl = { | 78 | struct flowi fl = { |
@@ -80,7 +81,7 @@ static int __ip_vs_addr_is_local_v6(const struct in6_addr *addr) | |||
80 | .fl6_src = { .s6_addr32 = {0, 0, 0, 0} }, | 81 | .fl6_src = { .s6_addr32 = {0, 0, 0, 0} }, |
81 | }; | 82 | }; |
82 | 83 | ||
83 | rt = (struct rt6_info *)ip6_route_output(&init_net, NULL, &fl); | 84 | rt = (struct rt6_info *)ip6_route_output(net, NULL, &fl); |
84 | if (rt && rt->rt6i_dev && (rt->rt6i_dev->flags & IFF_LOOPBACK)) | 85 | if (rt && rt->rt6i_dev && (rt->rt6i_dev->flags & IFF_LOOPBACK)) |
85 | return 1; | 86 | return 1; |
86 | 87 | ||
@@ -810,12 +811,12 @@ ip_vs_new_dest(struct ip_vs_service *svc, struct ip_vs_dest_user_kern *udest, | |||
810 | atype = ipv6_addr_type(&udest->addr.in6); | 811 | atype = ipv6_addr_type(&udest->addr.in6); |
811 | if ((!(atype & IPV6_ADDR_UNICAST) || | 812 | if ((!(atype & IPV6_ADDR_UNICAST) || |
812 | atype & IPV6_ADDR_LINKLOCAL) && | 813 | atype & IPV6_ADDR_LINKLOCAL) && |
813 | !__ip_vs_addr_is_local_v6(&udest->addr.in6)) | 814 | !__ip_vs_addr_is_local_v6(svc->net, &udest->addr.in6)) |
814 | return -EINVAL; | 815 | return -EINVAL; |
815 | } else | 816 | } else |
816 | #endif | 817 | #endif |
817 | { | 818 | { |
818 | atype = inet_addr_type(&init_net, udest->addr.ip); | 819 | atype = inet_addr_type(svc->net, udest->addr.ip); |
819 | if (atype != RTN_LOCAL && atype != RTN_UNICAST) | 820 | if (atype != RTN_LOCAL && atype != RTN_UNICAST) |
820 | return -EINVAL; | 821 | return -EINVAL; |
821 | } | 822 | } |