]> git.proxmox.com Git - mirror_ovs.git/commitdiff
datapath: Conditionally define skb_unclone in datapath compat code
authorKyle Mestery <kmestery@cisco.com>
Mon, 22 Jul 2013 14:38:13 +0000 (10:38 -0400)
committerJesse Gross <jesse@nicira.com>
Mon, 22 Jul 2013 17:24:18 +0000 (10:24 -0700)
Recent versions of Fedora have skb_unclone included in their
kernels. This patch adds a conditional check into the compat directory so as
not to error out by defining it twice. This allows the latest OVS kernel
module to build on Fedora 19.

Signed-off-by: Kyle Mestery <kmestery@cisco.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
acinclude.m4
datapath/linux/compat/include/linux/skbuff.h

index 717c68166177009a8d6636d268713e2e216ddef3..30a4dc6d68d7e77d80ea18e1880f3535b8f4ef21 100644 (file)
@@ -256,6 +256,7 @@ AC_DEFUN([OVS_CHECK_LINUX_COMPAT], [
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [consume_skb])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_frag_page])
   OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_reset_mac_len])
+  OVS_GREP_IFELSE([$KSRC/include/linux/skbuff.h], [skb_unclone])
 
   OVS_GREP_IFELSE([$KSRC/include/linux/string.h], [kmemdup], [],
                   [OVS_GREP_IFELSE([$KSRC/include/linux/slab.h], [kmemdup])])
index c9c103d0c54b3683096afd96bc682ea1187a1e54..461e07cfb0a0d2ecd065c20e301054e9ca6675ad 100644 (file)
@@ -252,6 +252,7 @@ static inline void skb_reset_mac_len(struct sk_buff *skb)
 }
 #endif
 
+#ifndef HAVE_SKB_UNCLONE
 static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
 {
        might_sleep_if(pri & __GFP_WAIT);
@@ -261,6 +262,7 @@ static inline int skb_unclone(struct sk_buff *skb, gfp_t pri)
 
        return 0;
 }
+#endif
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37)
 extern u32 __skb_get_rxhash(struct sk_buff *skb);