aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChangli Gao <xiaosuo@gmail.com>2010-08-04 00:43:44 -0400
committerDavid S. Miller <davem@davemloft.net>2010-08-05 00:53:14 -0400
commitf9599ce11192f24dbb0f4fdb70121a05edc58342 (patch)
tree12da3fa1947471845ac4277cc030e81fbfd78483 /include
parent36d12690a2e9bcacae5a2a7e0fb6345a3caad625 (diff)
sk_buff: introduce pskb_network_may_pull()
Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/skbuff.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index d20d9e7a9bbd..77eb60d2b496 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1379,6 +1379,11 @@ static inline int skb_network_offset(const struct sk_buff *skb)
1379 return skb_network_header(skb) - skb->data; 1379 return skb_network_header(skb) - skb->data;
1380} 1380}
1381 1381
1382static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len)
1383{
1384 return pskb_may_pull(skb, skb_network_offset(skb) + len);
1385}
1386
1382/* 1387/*
1383 * CPUs often take a performance hit when accessing unaligned memory 1388 * CPUs often take a performance hit when accessing unaligned memory
1384 * locations. The actual performance hit varies, it can be small if the 1389 * locations. The actual performance hit varies, it can be small if the