mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
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>
This commit is contained in:
parent
58be2427da
commit
ea6da4fd38
1 changed files with 5 additions and 0 deletions
|
@ -2184,6 +2184,11 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
|
||||||
return skb->head + skb->mac_header;
|
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)
|
static inline int skb_mac_header_was_set(const struct sk_buff *skb)
|
||||||
{
|
{
|
||||||
return skb->mac_header != (typeof(skb->mac_header))~0U;
|
return skb->mac_header != (typeof(skb->mac_header))~0U;
|
||||||
|
|
Loading…
Add table
Reference in a new issue