From 82d6256ac9f800f8cbe06cf2be41a7b76ab8b322 Mon Sep 17 00:00:00 2001 From: Jesse Gross Date: Thu, 16 Jun 2011 15:14:08 -0700 Subject: [PATCH] datapath: Backport consume_skb(). Kernels before 2.6.30 did not implement consume_skb() although RHEL backports it. For other kernels, this provides a backport. Signed-off-by: Jesse Gross Acked-by: Ben Pfaff --- acinclude.m4 | 1 + datapath/linux-2.6/compat-2.6/include/linux/skbuff.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/acinclude.m4 b/acinclude.m4 index 3cf793d4..63a036e3 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -204,6 +204,7 @@ AC_DEFUN([OVS_CHECK_LINUX26_COMPAT], [ [OVS_DEFINE([HAVE_ICMP6_HDR])]) OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [skb_warn_if_lro], [OVS_DEFINE([HAVE_SKB_WARN_LRO])]) + OVS_GREP_IFELSE([$KSRC26/include/linux/skbuff.h], [consume_skb]) OVS_GREP_IFELSE([$KSRC26/include/linux/string.h], [kmemdup], [], [OVS_GREP_IFELSE([$KSRC26/include/linux/slab.h], [kmemdup])]) diff --git a/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h b/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h index 9cd7e1d5..b728c517 100644 --- a/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h +++ b/datapath/linux-2.6/compat-2.6/include/linux/skbuff.h @@ -228,4 +228,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb) #endif /* NETIF_F_LRO */ #endif /* HAVE_SKB_WARN_LRO */ +#ifndef HAVE_CONSUME_SKB +#define consume_skb kfree_skb +#endif + #endif -- 2.30.2