ipvs: Pass ipvs not net into ip_vs_control_net_(init|cleanup)
[deliverable/linux.git] / net / netfilter / ipvs / ip_vs_core.c
index 77dcd3ed27de2e00fb821c17f11eb6a387f3c781..b5f451f20f522dfd7cbe7d2f98cc2669b1743df9 100644 (file)
@@ -1237,7 +1237,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff *skb, int af)
                                return verdict;
                }
 
-       pd = ip_vs_proto_data_get(net, iph.protocol);
+       pd = ip_vs_proto_data_get(ipvs, iph.protocol);
        if (unlikely(!pd))
                return NF_ACCEPT;
        pp = pd->pp;
@@ -1470,7 +1470,7 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
                ipip = true;
        }
 
-       pd = ip_vs_proto_data_get(net, cih->protocol);
+       pd = ip_vs_proto_data_get(ipvs, cih->protocol);
        if (!pd)
                return NF_ACCEPT;
        pp = pd->pp;
@@ -1633,7 +1633,7 @@ static int ip_vs_in_icmp_v6(struct sk_buff *skb, int *related,
 
        net = skb_net(skb);
        ipvs = net_ipvs(net);
-       pd = ip_vs_proto_data_get(net, ciph.protocol);
+       pd = ip_vs_proto_data_get(ipvs, ciph.protocol);
        if (!pd)
                return NF_ACCEPT;
        pp = pd->pp;
@@ -1765,7 +1765,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
                }
 
        /* Protocol supported? */
-       pd = ip_vs_proto_data_get(net, iph.protocol);
+       pd = ip_vs_proto_data_get(ipvs, iph.protocol);
        if (unlikely(!pd)) {
                /* The only way we'll see this packet again is if it's
                 * encapsulated, so mark it with ipvs_property=1 so we
@@ -1842,7 +1842,7 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
                pkts = atomic_add_return(1, &cp->in_pkts);
 
        if (ipvs->sync_state & IP_VS_STATE_MASTER)
-               ip_vs_sync_conn(net, cp, pkts);
+               ip_vs_sync_conn(ipvs, cp, pkts);
 
        ip_vs_conn_put(cp);
        return ret;
@@ -2075,7 +2075,7 @@ static int __net_init __ip_vs_init(struct net *net)
        if (ip_vs_estimator_net_init(net) < 0)
                goto estimator_fail;
 
-       if (ip_vs_control_net_init(net) < 0)
+       if (ip_vs_control_net_init(ipvs) < 0)
                goto control_fail;
 
        if (ip_vs_protocol_net_init(net) < 0)
@@ -2087,7 +2087,7 @@ static int __net_init __ip_vs_init(struct net *net)
        if (ip_vs_conn_net_init(net) < 0)
                goto conn_fail;
 
-       if (ip_vs_sync_net_init(net) < 0)
+       if (ip_vs_sync_net_init(ipvs) < 0)
                goto sync_fail;
 
        printk(KERN_INFO "IPVS: Creating netns size=%zu id=%d\n",
@@ -2104,7 +2104,7 @@ conn_fail:
 app_fail:
        ip_vs_protocol_net_cleanup(net);
 protocol_fail:
-       ip_vs_control_net_cleanup(net);
+       ip_vs_control_net_cleanup(ipvs);
 control_fail:
        ip_vs_estimator_net_cleanup(net);
 estimator_fail:
@@ -2120,7 +2120,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
        ip_vs_conn_net_cleanup(net);
        ip_vs_app_net_cleanup(net);
        ip_vs_protocol_net_cleanup(net);
-       ip_vs_control_net_cleanup(net);
+       ip_vs_control_net_cleanup(ipvs);
        ip_vs_estimator_net_cleanup(net);
        IP_VS_DBG(2, "ipvs netns %d released\n", ipvs->gen);
        net->ipvs = NULL;
@@ -2128,10 +2128,11 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
 
 static void __net_exit __ip_vs_dev_cleanup(struct net *net)
 {
+       struct netns_ipvs *ipvs = net_ipvs(net);
        EnterFunction(2);
-       net_ipvs(net)->enable = 0;      /* Disable packet reception */
+       ipvs->enable = 0;       /* Disable packet reception */
        smp_wmb();
-       ip_vs_sync_net_cleanup(net);
+       ip_vs_sync_net_cleanup(ipvs);
        LeaveFunction(2);
 }
 
This page took 0.025342 seconds and 5 git commands to generate.