]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ipvs: Pass ipvs not net to ip_vs_has_real_service
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 21 Sep 2015 18:01:50 +0000 (13:01 -0500)
committerSimon Horman <horms@verge.net.au>
Thu, 24 Sep 2015 00:34:34 +0000 (09:34 +0900)
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Acked-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: Simon Horman <horms@verge.net.au>
include/net/ip_vs.h
net/netfilter/ipvs/ip_vs_core.c
net/netfilter/ipvs/ip_vs_ctl.c

index 828b19b23e0241029386ec2f2ad3613181a93076..b93ee28fb011e9b97afcfda4eb60ca0ef3115006 100644 (file)
@@ -1413,7 +1413,7 @@ struct ip_vs_service *
 ip_vs_service_find(struct netns_ipvs *ipvs, int af, __u32 fwmark, __u16 protocol,
                  const union nf_inet_addr *vaddr, __be16 vport);
 
-bool ip_vs_has_real_service(struct net *net, int af, __u16 protocol,
+bool ip_vs_has_real_service(struct netns_ipvs *ipvs, int af, __u16 protocol,
                            const union nf_inet_addr *daddr, __be16 dport);
 
 int ip_vs_use_count_inc(void);
index 583199c2bcdc9a09d72673c2a8b81cee2f173566..c22e0692e22d3455edcc8d0a8021f084a3e3d003 100644 (file)
@@ -1186,6 +1186,7 @@ static unsigned int
 ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af)
 {
        struct net *net = NULL;
+       struct netns_ipvs *ipvs;
        struct ip_vs_iphdr iph;
        struct ip_vs_protocol *pp;
        struct ip_vs_proto_data *pd;
@@ -1211,7 +1212,8 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af)
                return NF_ACCEPT;
 
        net = skb_net(skb);
-       if (!net_ipvs(net)->enable)
+       ipvs = net_ipvs(net);
+       if (!ipvs->enable)
                return NF_ACCEPT;
 
        ip_vs_fill_iph_skb(af, skb, false, &iph);
@@ -1269,7 +1271,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af)
                                         sizeof(_ports), _ports, &iph);
                if (pptr == NULL)
                        return NF_ACCEPT;       /* Not for me */
-               if (ip_vs_has_real_service(net, af, iph.protocol, &iph.saddr,
+               if (ip_vs_has_real_service(ipvs, af, iph.protocol, &iph.saddr,
                                           pptr[0])) {
                        /*
                         * Notify the real server: there is no
index 67fe0c92e3f7b8cc2728be18db029c91924f7aed..8f914b67b41a0338444ca7619341df096d9af36e 100644 (file)
@@ -542,10 +542,9 @@ static void ip_vs_rs_unhash(struct ip_vs_dest *dest)
 }
 
 /* Check if real service by <proto,addr,port> is present */
-bool ip_vs_has_real_service(struct net *net, int af, __u16 protocol,
+bool ip_vs_has_real_service(struct netns_ipvs *ipvs, int af, __u16 protocol,
                            const union nf_inet_addr *daddr, __be16 dport)
 {
-       struct netns_ipvs *ipvs = net_ipvs(net);
        unsigned int hash;
        struct ip_vs_dest *dest;