Skip to content

Commit 488a9d1

Browse files
author
Justin Pettit
committed
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.
1 parent 9cbd4a4 commit 488a9d1

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

acinclude.m4

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [
150150
151151
OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_disable_lro],
152152
[OVS_DEFINE([HAVE_DEV_DISABLE_LRO])])
153+
OVS_GREP_IFELSE([$KSRC26/include/linux/netdevice.h], [dev_get_stats],
154+
[OVS_DEFINE([HAVE_DEV_GET_STATS])])
153155
154156
# Check for the proto_data_valid member in struct sk_buff. The [^@]
155157
# is necessary because some versions of this header remove the

datapath/linux-2.6/compat-2.6/include/linux/netdevice.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extern void unregister_netdevice_many(struct list_head *head);
7777
extern void dev_disable_lro(struct net_device *dev);
7878
#endif
7979

80-
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
80+
#ifndef HAVE_DEV_GET_STATS
8181
static inline const struct net_device_stats *
8282
dev_get_stats(struct net_device *dev)
8383
{

0 commit comments

Comments
 (0)