From: Michał Mirosław Date: Tue, 14 Dec 2010 15:24:08 +0000 (+0000) Subject: net: Introduce skb_checksum_start_offset() X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=04fb451eff978ca059399eab83d5594b073caf6f;p=linux-beck.git net: Introduce skb_checksum_start_offset() Introduce skb_checksum_start_offset() to replace repetitive calculation. Signed-off-by: Michał Mirosław Signed-off-by: David S. Miller --- 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;