diff options
-rw-r--r-- | compat.h | 32 |
1 files changed, 7 insertions, 25 deletions
@@ -12,31 +12,13 @@ #include <linux/version.h> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22) -#include <linux/skbuff.h> -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.raw = skb->data; -} - -static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) -{ - skb->mac.raw = skb->data + offset; -} - -static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) -{ - return skb->end; -} - -static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) -{ - return skb->tail; -} +#define skb_mac_header(_skb) ((_skb)->mac.raw) +#define skb_reset_mac_header(_skb) \ + do { (_skb)->mac.raw = (_skb)->data; } while(0) +#define skb_set_mac_header(_skb, _offset) \ + do { (_skb)->mac.raw = (_skb)->data + (_offset); } while(0) +#define skb_end_pointer(_skb) ((_skb)->end) +#define skb_tail_pointer(_skb) ((_skb)->tail) #endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20) |