From c5ccff0db1e0ef75e36a414e8c0c2b8421cdeda8 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Mon, 5 Apr 2010 22:38:31 -0400 Subject: [PATCH] datapath: Add dev_get_stats compatibility function. The dev_get_stats function wasn't added until 2.6.29 so provide a replacement for it. --- datapath/linux-2.6/compat-2.6/include/linux/netdevice.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h b/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h index 924dc0d3e..7080d0128 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/netdevice.h @@ -77,4 +77,12 @@ extern void unregister_netdevice_many(struct list_head *head); extern void dev_disable_lro(struct net_device *dev); #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) +static inline const struct net_device_stats * +dev_get_stats(struct net_device *dev) +{ + return dev->get_stats(dev); +} +#endif + #endif -- 2.43.0