From: Ben Pfaff Date: Fri, 10 Dec 2010 22:45:38 +0000 (-0800) Subject: datapath: Fix off-by-one error in dev_get_stats() compat code. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0f34eb123011f848083b49384ac82e5a57c8c5d1;p=openvswitch datapath: Fix off-by-one error in dev_get_stats() compat code. dev_get_stats() was introduced in 2.6.29, not 2.6.28. Signed-off-by: Ben Pfaff Acked-by: Jesse Gross --- diff --git a/datapath/linux-2.6/compat-2.6/netdevice.c b/datapath/linux-2.6/compat-2.6/netdevice.c index 29804584..1a6f327a 100644 --- a/datapath/linux-2.6/compat-2.6/netdevice.c +++ b/datapath/linux-2.6/compat-2.6/netdevice.c @@ -14,11 +14,11 @@ struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, { const struct net_device_stats *stats; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) stats = dev->get_stats(dev); -#else /* 2.6.28 <= kernel version < 2.6.36 */ +#else /* 2.6.28 < kernel version < 2.6.36 */ stats = (dev_get_stats)(dev); -#endif /* 2.6.28 <= kernel version < 2.6.36 */ +#endif /* 2.6.28 < kernel version < 2.6.36 */ storage->rx_packets = stats->rx_packets; storage->tx_packets = stats->tx_packets;