ipv4: Explicitly compute net in ip_fragment
authorEric W. Biederman <ebiederm@xmission.com>
Wed, 16 Sep 2015 01:04:00 +0000 (20:04 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2015 00:18:34 +0000 (17:18 -0700)
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c

index 85b72d450184693a498cc464e971466006087d92..095754c9906107485b141371397b072eb146d571 100644 (file)
@@ -500,10 +500,9 @@ static int ip_fragment(struct sock *sk, struct sk_buff *skb,
        if (unlikely(!skb->ignore_df ||
                     (IPCB(skb)->frag_max_size &&
                      IPCB(skb)->frag_max_size > mtu))) {
-               struct rtable *rt = skb_rtable(skb);
-               struct net_device *dev = rt->dst.dev;
+               struct net *net = dev_net(skb_rtable(skb)->dst.dev);
 
-               IP_INC_STATS(dev_net(dev), IPSTATS_MIB_FRAGFAILS);
+               IP_INC_STATS(net, IPSTATS_MIB_FRAGFAILS);
                icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED,
                          htonl(mtu));
                kfree_skb(skb);