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
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;