提交 ea6da4fd 编写于 作者: A Amir Vadai 提交者: David S. Miller

net/skbuff: Introduce skb_mac_offset()

Introduce skb_mac_offset() that could be used to get mac header offset.
Signed-off-by: NAmir Vadai <amir@vadai.me>
Reviewed-by: NOr Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 58be2427
...@@ -2184,6 +2184,11 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb) ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册