Commit f9599ce1 authored by Changli Gao's avatar Changli Gao Committed by David S. Miller

sk_buff: introduce pskb_network_may_pull()

Signed-off-by: default avatarChangli Gao <xiaosuo@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 36d12690
...@@ -1379,6 +1379,11 @@ static inline int skb_network_offset(const struct sk_buff *skb) ...@@ -1379,6 +1379,11 @@ static inline int skb_network_offset(const struct sk_buff *skb)
return skb_network_header(skb) - skb->data; return skb_network_header(skb) - skb->data;
} }
static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
{
return pskb_may_pull(skb, skb_network_offset(skb) + len);
}
/* /*
* CPUs often take a performance hit when accessing unaligned memory * CPUs often take a performance hit when accessing unaligned memory
* locations. The actual performance hit varies, it can be small if the * locations. The actual performance hit varies, it can be small if the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment