Compatibility fixes for 2.6.18 kernel
[openvswitch] / datapath / linux-2.6 / compat-2.6 / include / linux / skbuff.h
index 677267475b6138680023f720f6913913f6ee7930..9430f5271124b84d2d0c785af2064ba9c61ca725 100644 (file)
@@ -16,16 +16,19 @@ static inline void kfree_skb_maybe_null(struct sk_buff *skb)
 }
 #endif
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
-
-#define mac_header mac.raw
-#define network_header nh.raw
-
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,19)
 /* Note that CHECKSUM_PARTIAL is not implemented, but this allows us to at
  * least test against it: see update_csum() in forward.c. */
 #define CHECKSUM_PARTIAL 3
 #define CHECKSUM_COMPLETE CHECKSUM_HW
+#endif /* linux kernel < 2.6.19 */
+
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+
+#define mac_header mac.raw
+#define network_header nh.raw
 
 static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
 {
@@ -53,11 +56,20 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
        return skb->mac.raw;
 }
 
+static inline void skb_reset_mac_header(struct sk_buff *skb)
+{
+       skb->mac_header = skb->data;
+}
+
 static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
 {
        skb->mac.raw = skb->data + offset;
 }
 
+static inline int skb_transport_offset(const struct sk_buff *skb)
+{
+    return skb_transport_header(skb) - skb->data;
+}
 #endif /* linux kernel < 2.6.22 */
 
 #endif