Skip to content

Commit e5d5dec

Browse files
jasowangdavem330
authored andcommitted
net: core: let skb_partial_csum_set() set transport header
For untrusted packets with partial checksum, we need to set the transport header for precise packet length estimation. We can just let skb_pratial_csum_set() to do this to avoid extra call to skb_flow_dissect() and simplify the caller. Cc: Eric Dumazet <[email protected]> Signed-off-by: Jason Wang <[email protected]> Acked-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 7d3ac5c commit e5d5dec

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/core/skbuff.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3370,6 +3370,7 @@ bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
33703370
skb->ip_summed = CHECKSUM_PARTIAL;
33713371
skb->csum_start = skb_headroom(skb) + start;
33723372
skb->csum_offset = off;
3373+
skb_set_transport_header(skb, start);
33733374
return true;
33743375
}
33753376
EXPORT_SYMBOL_GPL(skb_partial_csum_set);

0 commit comments

Comments
 (0)