ipvs: Pass ipvs into ensure_mtu_is adequate
authorEric W. Biederman <ebiederm@xmission.com>
Mon, 21 Sep 2015 18:02:47 +0000 (13:02 -0500)
committerSimon Horman <horms@verge.net.au>
Thu, 24 Sep 2015 00:34:42 +0000 (09:34 +0900)
This allows two different ways for computing/guessing net to be
removed from ensure_mtu_is_adequate.

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_xmit.c

index 13a678a63ed5a11c31e9b8bb4b1c19fa8eb8fe7c..77182b9750cdc55a25a1f858367a0ef203f3fd3f 100644 (file)
@@ -212,13 +212,14 @@ static inline void maybe_update_pmtu(int skb_af, struct sk_buff *skb, int mtu)
                ort->dst.ops->update_pmtu(&ort->dst, sk, NULL, mtu);
 }
 
-static inline bool ensure_mtu_is_adequate(int skb_af, int rt_mode,
+static inline bool ensure_mtu_is_adequate(struct netns_ipvs *ipvs, int skb_af,
+                                         int rt_mode,
                                          struct ip_vs_iphdr *ipvsh,
                                          struct sk_buff *skb, int mtu)
 {
 #ifdef CONFIG_IP_VS_IPV6
        if (skb_af == AF_INET6) {
-               struct net *net = dev_net(skb_dst(skb)->dev);
+               struct net *net = ipvs->net;
 
                if (unlikely(__mtu_check_toobig_v6(skb, mtu))) {
                        if (!skb->dev)
@@ -233,8 +234,6 @@ static inline bool ensure_mtu_is_adequate(int skb_af, int rt_mode,
        } else
 #endif
        {
-               struct netns_ipvs *ipvs = net_ipvs(skb_net(skb));
-
                /* If we're going to tunnel the packet and pmtu discovery
                 * is disabled, we'll just fragment it anyway
                 */
@@ -338,7 +337,7 @@ __ip_vs_get_out_rt(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
                maybe_update_pmtu(skb_af, skb, mtu);
        }
 
-       if (!ensure_mtu_is_adequate(skb_af, rt_mode, ipvsh, skb, mtu))
+       if (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))
                goto err_put;
 
        skb_dst_drop(skb);
@@ -487,7 +486,7 @@ __ip_vs_get_out_rt_v6(struct netns_ipvs *ipvs, int skb_af, struct sk_buff *skb,
                maybe_update_pmtu(skb_af, skb, mtu);
        }
 
-       if (!ensure_mtu_is_adequate(skb_af, rt_mode, ipvsh, skb, mtu))
+       if (!ensure_mtu_is_adequate(ipvs, skb_af, rt_mode, ipvsh, skb, mtu))
                goto err_put;
 
        skb_dst_drop(skb);
This page took 0.025933 seconds and 5 git commands to generate.