aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2010-12-14 10:24:08 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-16 17:43:14 -0500
commit04fb451eff978ca059399eab83d5594b073caf6f (patch)
tree6ef0da9466839c475ab939d55504d57c62cd48c6 /include/linux
parentbc2ce894e113ed95b92541134b002fdc641e8080 (diff)
net: Introduce skb_checksum_start_offset()
Introduce skb_checksum_start_offset() to replace repetitive calculation. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-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 4c4bec6316d9..20ec0a64cb9f 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1355,6 +1355,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
1355} 1355}
1356#endif /* NET_SKBUFF_DATA_USES_OFFSET */ 1356#endif /* NET_SKBUFF_DATA_USES_OFFSET */
1357 1357
1358static inline int skb_checksum_start_offset(const struct sk_buff *skb)
1359{
1360 return skb->csum_start - skb_headroom(skb);
1361}
1362
1358static inline int skb_transport_offset(const struct sk_buff *skb) 1363static inline int skb_transport_offset(const struct sk_buff *skb)
1359{ 1364{
1360 return skb_transport_header(skb) - skb->data; 1365 return skb_transport_header(skb) - skb->data;