datapath: Fix build breakage on kernel 2.6.40
[openvswitch] / datapath / linux / compat / include / linux / skbuff.h
index ccf471714854e5d2166a07c6ca9e3e4b3c7872d6..96d80124f927075a977f61d2994244e4fd3b4320 100644 (file)
@@ -232,4 +232,17 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
 #define consume_skb kfree_skb
 #endif
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,2,0)
+static inline struct page *skb_frag_page(const skb_frag_t *frag)
+{
+       return frag->page;
+}
+#endif
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,40)
+static inline void skb_reset_mac_len(struct sk_buff *skb)
+{
+       skb->mac_len = skb->network_header - skb->mac_header;
+}
+#endif
 #endif