ipvs: Use state->net in the ipvs forward functions
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 21 Sep 2015 18:01:40 +0000 (13:01 -0500)
committerSimon Horman <horms@verge.net.au>
Thu, 24 Sep 2015 00:34:33 +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>
net/netfilter/ipvs/ip_vs_core.c

index 1fa12edccbcc6481be3407fcb2e872d8c0183f29..3f33a076aaec959b5d099f85e1038fb9b671d203 100644 (file)
@@ -1905,15 +1905,13 @@ ip_vs_forward_icmp(void *priv, struct sk_buff *skb,
                   const struct nf_hook_state *state)
 {
        int r;
-       struct net *net;
        struct netns_ipvs *ipvs;
 
        if (ip_hdr(skb)->protocol != IPPROTO_ICMP)
                return NF_ACCEPT;
 
        /* ipvs enabled in this netns ? */
-       net = skb_net(skb);
-       ipvs = net_ipvs(net);
+       ipvs = net_ipvs(state->net);
        if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
                return NF_ACCEPT;
 
@@ -1926,7 +1924,6 @@ ip_vs_forward_icmp_v6(void *priv, struct sk_buff *skb,
                      const struct nf_hook_state *state)
 {
        int r;
-       struct net *net;
        struct netns_ipvs *ipvs;
        struct ip_vs_iphdr iphdr;
 
@@ -1935,8 +1932,7 @@ ip_vs_forward_icmp_v6(void *priv, struct sk_buff *skb,
                return NF_ACCEPT;
 
        /* ipvs enabled in this netns ? */
-       net = skb_net(skb);
-       ipvs = net_ipvs(net);
+       ipvs = net_ipvs(state->net);
        if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
                return NF_ACCEPT;