History

net/skbuff: Introduce skb_mac_offset()

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

Amir Vadai committed 9 years ago

Commit ea6da4f1 parent 58be2421 file · +5 −0Browse files

Unified · Split

include/linux/skbuff.h+5−0
@@ -2184,6 +2184,11 @@ static inline unsigned char *skb_mac_header(const struct sk_buff *skb) · 2183 unmodified lines
2184 return skb->head + skb->mac_header;2184 return skb->head + skb->mac_header;
2185}2185}
2186 2186
2187static inline int skb_mac_offset(const struct sk_buff *skb)
2188{
2189 return skb_mac_header(skb) - skb->data;
2190}
2191
2187static inline int skb_mac_header_was_set(const struct sk_buff *skb)2192static inline int skb_mac_header_was_set(const struct sk_buff *skb)
2188{2193{
2189 return skb->mac_header != (typeof(skb->mac_header))~0U;2194 return skb->mac_header != (typeof(skb->mac_header))~0U;