Skip to content

Commit 04fb451

Browse files
osctobedavem330
authored andcommitted
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>
1 parent bc2ce89 commit 04fb451

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

‎include/linux/skbuff.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,6 +1355,11 @@ static inline void skb_set_mac_header(struct sk_buff *skb, const int offset)
13551355
}
13561356
#endif /* NET_SKBUFF_DATA_USES_OFFSET */
13571357

1358+
static inline int skb_checksum_start_offset(const struct sk_buff *skb)
1359+
{
1360+
return skb->csum_start - skb_headroom(skb);
1361+
}
1362+
13581363
static inline int skb_transport_offset(const struct sk_buff *skb)
13591364
{
13601365
return skb_transport_header(skb) - skb->data;

0 commit comments

Comments
 (0)