diff mbox series

[net-next] tcp: do not clear again skb->csum in tcp_init_nondata_skb()

Message ID 1509715139.2849.53.camel@edumazet-glaptop3.roam.corp.google.com
State Accepted, archived
Delegated to: David Miller
Headers show
Series [net-next] tcp: do not clear again skb->csum in tcp_init_nondata_skb() | expand

Commit Message

Eric Dumazet Nov. 3, 2017, 1:18 p.m. UTC
From: Eric Dumazet <edumazet@google.com>

tcp_init_nondata_skb() is fed with freshly allocated skbs.
They already have a cleared csum field, no need to clear it again.

This is based on Neal review on commit 3b11775033dc ("tcp: do not mangle
skb->cb[] in tcp_make_synack()"), noticing I did not clear skb->csum.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: Neal Cardwell <ncardwell@google.com>
---
 net/ipv4/tcp_output.c |    1 -
 1 file changed, 1 deletion(-)

Comments

David Miller Nov. 5, 2017, 1:15 p.m. UTC | #1
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Fri, 03 Nov 2017 06:18:59 -0700

> From: Eric Dumazet <edumazet@google.com>
> 
> tcp_init_nondata_skb() is fed with freshly allocated skbs.
> They already have a cleared csum field, no need to clear it again.
> 
> This is based on Neal review on commit 3b11775033dc ("tcp: do not mangle
> skb->cb[] in tcp_make_synack()"), noticing I did not clear skb->csum.
> 
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Reported-by: Neal Cardwell <ncardwell@google.com>

Applied.
diff mbox series

Patch

diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 822962ece2840824db3d89993f6889780cd2ab99..0b8062274ed2bf1c2781fe7e88f0de97f6ab6e55 100644
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
@@ -381,7 +381,6 @@  static void tcp_ecn_send(struct sock *sk, struct sk_buff *skb,
 static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u8 flags)
 {
 	skb->ip_summed = CHECKSUM_PARTIAL;
-	skb->csum = 0;
 
 	TCP_SKB_CB(skb)->tcp_flags = flags;
 	TCP_SKB_CB(skb)->sacked = 0;