[ovs-dev] [PATCH 4/5] datapath: Backport sec_path functions.
Ben Pfaff
blp at nicira.com
Wed Oct 19 00:02:00 UTC 2011
From: Justin Pettit <jpettit at nicira.com>
The functions to retrieve the sec_path from a skb didn't exist
until 2.6.29, so this backports them.
Signed-off-by: Justin Pettit <jpettit at nicira.com>
Signed-off-by: Jesse Gross <jesse at nicira.com>
Acked-by: Ben Pfaff <blp at nicira.com>
---
datapath/linux/compat/include/linux/skbuff.h | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)
diff --git a/datapath/linux/compat/include/linux/skbuff.h b/datapath/linux/compat/include/linux/skbuff.h
index b728c51..5190dc6 100644
--- a/datapath/linux/compat/include/linux/skbuff.h
+++ b/datapath/linux/compat/include/linux/skbuff.h
@@ -232,4 +232,18 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
#define consume_skb kfree_skb
#endif
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29)
+#ifdef CONFIG_XFRM
+static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
+{
+ return skb->sp;
+}
+#else
+static inline struct sec_path *skb_sec_path(struct sk_buff *skb)
+{
+ return NULL;
+}
+#endif
+#endif
+
#endif
--
1.7.4.4
More information about the dev
mailing list