# Re: \[PATCH net-next 1/3\] net: core: let skb\_partial\_csum\_set() set transport header

- From: Eric Dumazet \<hidden\>
- Date: 2013-03-27 14:43:01 
- List: netdev
- Page: https://ratatoskr.run/netdev/2013/03/4024715
- Thread: https://ratatoskr.run/netdev/2013/03/4024487/t.md

```text
On Wed, 2013-03-27 at 17:11 +0800, Jason Wang wrote:
> 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 <redacted>
> Signed-off-by: Jason Wang <redacted>
> ---
>  net/core/skbuff.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/net/core/skbuff.c b/net/core/skbuff.c
> index 31c6737..ba64614 100644
> --- a/net/core/skbuff.c
> +++ b/net/core/skbuff.c
> @@ -3370,6 +3370,7 @@ bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off)
>  	skb->ip_summed = CHECKSUM_PARTIAL;
>  	skb->csum_start = skb_headroom(skb) + start;
>  	skb->csum_offset = off;
> +	skb_set_transport_header(skb, start);
>  	return true;
>  }
>  EXPORT_SYMBOL_GPL(skb_partial_csum_set);

Acked-by: Eric Dumazet <redacted>
```
