Introduce skb_mac_offset() that could be used to get mac header offset.
Unified · Split
| @@ -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 | ||
| 2187 | static inline int skb_mac_offset(const struct sk_buff *skb) | ||
| 2188 | { | ||
| 2189 | return skb_mac_header(skb) - skb->data; | ||
| 2190 | } | ||
| 2191 | |||
| 2187 | static inline int skb_mac_header_was_set(const struct sk_buff *skb) | 2192 | static 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; |