diff mbox series

[ovs-dev,2/6] compat: Do not include headers when not compiling

Message ID 1512518481-5944-3-git-send-email-gvrose8192@gmail.com
State Superseded
Headers show
Series Enable OVS on Linux 4.14 kernel | expand

Commit Message

Gregory Rose Dec. 6, 2017, 12:01 a.m. UTC
If the entire file is not going to be compiled due to compilation time
directives then don't bother pulling in the headers. This fixes a
compilation error on Linux 4.14.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/linux/compat/ip_gre.c    | 2 +-
 datapath/linux/compat/ip_output.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/datapath/linux/compat/ip_gre.c b/datapath/linux/compat/ip_gre.c
index 03c5435..2579093 100644
--- a/datapath/linux/compat/ip_gre.c
+++ b/datapath/linux/compat/ip_gre.c
@@ -12,6 +12,7 @@ 
 
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
 
+#ifndef USE_UPSTREAM_TUNNEL
 #include <linux/capability.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -52,7 +53,6 @@ 
 #include <net/gre.h>
 #include <net/dst_metadata.h>
 
-#ifndef USE_UPSTREAM_TUNNEL
 #if IS_ENABLED(CONFIG_IPV6)
 #include <net/ipv6.h>
 #include <net/ip6_fib.h>
diff --git a/datapath/linux/compat/ip_output.c b/datapath/linux/compat/ip_output.c
index edca340..e2f869f 100644
--- a/datapath/linux/compat/ip_output.c
+++ b/datapath/linux/compat/ip_output.c
@@ -45,6 +45,7 @@ 
  *		Hirokazu Takahashi:	sendfile() on UDP works now.
  */
 
+#ifndef HAVE_CORRECT_MRU_HANDLING
 #include <asm/uaccess.h>
 #include <linux/module.h>
 #include <linux/types.h>
@@ -82,7 +83,6 @@ 
 #include <linux/netlink.h>
 #include <linux/tcp.h>
 
-#ifndef HAVE_CORRECT_MRU_HANDLING
 static inline void rpl_ip_options_fragment(struct sk_buff *skb)
 {
 	unsigned char *optptr = skb_network_header(skb) + sizeof(struct iphdr);