[ovs-dev] [PATCH] datapath: Fix build on 2.6.18.

Ben Pfaff blp at nicira.com
Wed Nov 10 00:22:47 UTC 2010


Build-tested (only) on 2.6.18 from XenServer 5.5.0, 2.6.26, 2.6.29, 2.6.34,
and 2.6.36.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 include/linux/if_link.h |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 41f1a9c..6181a5d 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -1,9 +1,19 @@
 #ifndef __LINUX_IF_LINK_WRAPPER_H
 #define __LINUX_IF_LINK_WRAPPER_H 1
 
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,19)
 #include_next <linux/if_link.h>
+#else
+/* Before 2.6.19 there was no <linux/if_link.h>.  Instead all of the types now
+ * declared there were in <linux/if.h>.  Unfortunately <linux/if.h> from 2.6.18
+ * conflicts badly enough with <net/if.h> to break the userspace build.  All
+ * we really need from <linux/if_link.h> is struct rtnl_link_stats64, which in
+ * turn only really needs __u64.  */
+#include <linux/types.h>
+#endif
 
-#include <linux/version.h>
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)
 /* The main device statistics structure */
 struct rtnl_link_stats64 {
-- 
1.7.1





More information about the dev mailing list