summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2010-12-14 16:24:08 +0100
committerDavid S. Miller <davem@davemloft.net>2010-12-16 23:43:14 +0100
commit04fb451eff978ca059399eab83d5594b073caf6f (patch)
tree6ef0da9466839c475ab939d55504d57c62cd48c6
parenttcp: relax tcp_paws_check() (diff)
downloadlinux-04fb451eff978ca059399eab83d5594b073caf6f.tar.xz
linux-04fb451eff978ca059399eab83d5594b073caf6f.zip
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>
-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)
}
#endif /* NET_SKBUFF_DATA_USES_OFFSET */
+static inline int skb_checksum_start_offset(const struct sk_buff *skb)
+{
+ return skb->csum_start - skb_headroom(skb);
+}
+
static inline int skb_transport_offset(const struct sk_buff *skb)
{
return skb_transport_header(skb) - skb->data;