diff options
| author | Michał Mirosław <mirq-linux@rere.qmqm.pl> | 2010-12-14 10:24:08 -0500 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2010-12-16 17:43:14 -0500 |
| commit | 04fb451eff978ca059399eab83d5594b073caf6f (patch) | |
| tree | 6ef0da9466839c475ab939d55504d57c62cd48c6 /include/linux/skbuff.h | |
| parent | bc2ce894e113ed95b92541134b002fdc641e8080 (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/skbuff.h')
| -rw-r--r-- | include/linux/skbuff.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4c4bec6316d..20ec0a64cb9 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 | ||
| 1358 | static inline int skb_checksum_start_offset(const struct sk_buff *skb) | ||
| 1359 | { | ||
| 1360 | return skb->csum_start - skb_headroom(skb); | ||
| 1361 | } | ||
| 1362 | |||
| 1358 | static inline int skb_transport_offset(const struct sk_buff *skb) | 1363 | static 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; |
