OSDN Git Service

tcp: do not clear again skb->csum in tcp_init_nondata_skb()
authorEric Dumazet <edumazet@google.com>
Fri, 3 Nov 2017 13:18:59 +0000 (06:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 5 Nov 2017 13:14:54 +0000 (22:14 +0900)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_output.c

index b98b2f7..a9d917e 100644 (file)
@@ -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;