diff options
author | Amir Vadai <amir@vadai.me> | 2017-02-07 10:56:06 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-02-10 21:18:33 +0300 |
commit | ea6da4fd388a1eeab30d64da3eab3c5338714c74 (patch) | |
tree | 9f1e293f9716b781a1c099dfec6c68bb360cfae1 /include/linux/skbuff.h | |
parent | 58be2427da98a17426cff3d30c50e419781a230b (diff) | |
download | linux-ea6da4fd388a1eeab30d64da3eab3c5338714c74.tar.xz |
net/skbuff: Introduce skb_mac_offset()
Introduce skb_mac_offset() that could be used to get mac header offset.
Signed-off-by: Amir Vadai <amir@vadai.me>
Reviewed-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/skbuff.h')
-rw-r--r-- | include/linux/skbuff.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f1adddc1c5ac..69ccd2636911 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -2184,6 +2184,11 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb) return skb->head + skb->mac_header; } +static inline int skb_mac_offset(const struct sk_buff *skb) +{ + return skb_mac_header(skb) - skb->data; +} + static inline int skb_mac_header_was_set(const struct sk_buff *skb) { return skb->mac_header != (typeof(skb->mac_header))~0U; |