Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 04fb451e authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller
Browse files

net: Introduce skb_checksum_start_offset()



Introduce skb_checksum_start_offset() to replace repetitive calculation.

Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bc2ce894
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;