]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - net/core/rtnetlink.c
net: fix 64 bit counters on 32 bit arches
[net-next-2.6.git] / net / core / rtnetlink.c
index 1a2af24e9e3d2b3754fa032e261a9480b4d0b7ac..5e773ea2201dfd049df0d12751aaefa3c4cdb370 100644 (file)
@@ -579,7 +579,7 @@ static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
 }
 
 static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
-                                const struct net_device_stats *b)
+                                const struct rtnl_link_stats64 *b)
 {
        a->rx_packets = b->rx_packets;
        a->tx_packets = b->tx_packets;
@@ -610,7 +610,7 @@ static void copy_rtnl_link_stats(struct rtnl_link_stats *a,
        a->tx_compressed = b->tx_compressed;
 }
 
-static void copy_rtnl_link_stats64(void *v, const struct net_device_stats *b)
+static void copy_rtnl_link_stats64(void *v, const struct rtnl_link_stats64 *b)
 {
        struct rtnl_link_stats64 a;
 
@@ -791,7 +791,8 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
 {
        struct ifinfomsg *ifm;
        struct nlmsghdr *nlh;
-       const struct net_device_stats *stats;
+       struct rtnl_link_stats64 temp;
+       const struct rtnl_link_stats64 *stats;
        struct nlattr *attr;
 
        nlh = nlmsg_put(skb, pid, seq, type, sizeof(*ifm), flags);
@@ -847,7 +848,7 @@ static int rtnl_fill_ifinfo(struct sk_buff *skb, struct net_device *dev,
        if (attr == NULL)
                goto nla_put_failure;
 
-       stats = dev_get_stats(dev);
+       stats = dev_get_stats(dev, &temp);
        copy_rtnl_link_stats(nla_data(attr), stats);
 
        attr = nla_reserve(skb, IFLA_STATS64,