Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ea6da4fd authored by Amir Vadai's avatar Amir Vadai Committed by David S. Miller
Browse files

net/skbuff: Introduce skb_mac_offset()



Introduce skb_mac_offset() that could be used to get mac header offset.

Signed-off-by: default avatarAmir Vadai <amir@vadai.me>
Reviewed-by: default avatarOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 58be2427
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;