Skip to content

Commit

Permalink
datapath: Conditionally define skb_unclone in datapath compat code
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jesse Gross <[email protected]>
  • Loading branch information
mestery authored and jessegross committed Jul 22, 2013
1 parent 1b7ee51 commit dc0d542
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions acinclude.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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])])
Expand Down
2 changes: 2 additions & 0 deletions datapath/linux/compat/include/linux/skbuff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down

0 comments on commit dc0d542

Please sign in to comment.