From 488a9d1703a182529d53d80c7ab5a1b608a3600a Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 17 May 2010 14:13:32 -0700 Subject: [PATCH] datapath: Fix build with backported dev_get_stats(). An upcoming backport adds dev_get_stats() to a pre-2.6.29 Linux kernel, so we have to check for the presence of an dev_get_stats() definition instead of for the particular kernel version. --- acinclude.m4 | 2 ++ datapath/linux-2.6/compat-2.6/include/linux/netdevice.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/acinclude.m4 b/acinclude.m4 index 8643cf7b..6a37443a 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -150,6 +150,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_disable_lro], [OVS_DEFINE([HAVE_DEV_DISABLE_LRO])]) + OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_stats], + [OVS_DEFINE([HAVE_DEV_GET_STATS])]) # Check for the proto_data_valid member in struct sk_buff. The [^@] # is necessary because some versions of this header remove the 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 2a05f370..1e354e72 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,7 +77,7 @@ 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) +#ifndef HAVE_DEV_GET_STATS static inline const struct net_device_stats * dev_get_stats(struct net_device *dev) { -- 2.30.2