[SK_BUFF]: Introduce skb_network_offset()
For the quite common 'skb->nh.raw - skb->data' sequence. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e7dd65dafd
commit
bbe735e424
18 changed files with 33 additions and 28 deletions
|
@ -965,6 +965,11 @@ static inline void skb_reset_network_header(struct sk_buff *skb)
|
|||
skb->nh.raw = skb->data;
|
||||
}
|
||||
|
||||
static inline int skb_network_offset(const struct sk_buff *skb)
|
||||
{
|
||||
return skb->nh.raw - skb->data;
|
||||
}
|
||||
|
||||
static inline unsigned char *skb_mac_header(const struct sk_buff *skb)
|
||||
{
|
||||
return skb->mac.raw;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue