From: Amir Vadai Date: Tue, 7 Feb 2017 07:56:06 +0000 (+0200) Subject: net/skbuff: Introduce skb_mac_offset() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea6da4fd388a1eeab30d64da3eab3c5338714c74;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git net/skbuff: Introduce skb_mac_offset() Introduce skb_mac_offset() that could be used to get mac header offset. Signed-off-by: Amir Vadai Reviewed-by: Or Gerlitz Signed-off-by: David S. Miller --- 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;