[ovs-dev] [PATCH branch-1.9] datapath: Check for backported removal of HAVE_NET_DEVICE_OPS

Jesse Gross jesse at nicira.com
Fri Sep 13 21:37:35 UTC 2013


The symbol HAVE_NET_DEVICE_OPS was removed in 3.1 even though these ops
still exist, so on newer kernels we define the symbol ourselves. However,
SLES 11 SP3 appears to have backported this symbol removal. This simply
defines the symbol on all kernels where it is relevant, unless it is
already defined.

Reported-by: Cristina Palomo Regidor <cristina.palomo.regidor at ericsson.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
---
On master, this code can be removed altogether because all kernels 2.6.32+
use net_device_ops. Therefore, this is just a patch for older branches.
---
 datapath/vport-internal_dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/datapath/vport-internal_dev.c b/datapath/vport-internal_dev.c
index 4dc2eb4..992eb1d 100644
--- a/datapath/vport-internal_dev.c
+++ b/datapath/vport-internal_dev.c
@@ -35,9 +35,11 @@
 #include "vport-internal_dev.h"
 #include "vport-netdev.h"
 
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,29)
+#ifndef HAVE_NET_DEVICE_OPS
 #define HAVE_NET_DEVICE_OPS
 #endif
+#endif
 
 struct internal_dev {
 	struct vport *vport;
-- 
1.8.1.2




More information about the dev mailing list