]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
net/skbuff: Introduce skb_mac_offset()
authorAmir Vadai <amir@vadai.me>
Tue, 7 Feb 2017 07:56:06 +0000 (09:56 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2017 18:18:33 +0000 (13:18 -0500)
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>
include/linux/skbuff.h

index f1adddc1c5ac67c350e280d89abc3f3c10e2dbac..69ccd26369112031a9c47b246da6e94d576c1ebd 100644 (file)
@@ -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;