Skip to content

Commit ea6da4f

Browse files
amirvdavem330
authored andcommitted
net/skbuff: Introduce skb_mac_offset()
Introduce skb_mac_offset() that could be used to get mac header offset. Signed-off-by: Amir Vadai <[email protected]> Reviewed-by: Or Gerlitz <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 58be242 commit ea6da4f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/linux/skbuff.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2184,6 +2184,11 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
21842184
return skb->head + skb->mac_header;
21852185
}
21862186

2187+
static inline int skb_mac_offset(const struct sk_buff *skb)
2188+
{
2189+
return skb_mac_header(skb) - skb->data;
2190+
}
2191+
21872192
static inline int skb_mac_header_was_set(const struct sk_buff *skb)
21882193
{
21892194
return skb->mac_header != (typeof(skb->mac_header))~0U;

0 commit comments

Comments
 (0)