OSDN Git Service

tcp: do not clear skb->csum if already zero
authorEric Dumazet <edumazet@google.com>
Wed, 27 Oct 2021 20:19:22 +0000 (13:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Oct 2021 11:44:39 +0000 (12:44 +0100)
Freshly allocated skbs have their csum field cleared already.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp.c
net/ipv4/tcp_output.c
net/ipv6/tcp_ipv6.c

index c58d448..88475b6 100644 (file)
@@ -658,7 +658,6 @@ void tcp_skb_entail(struct sock *sk, struct sk_buff *skb)
        struct tcp_sock *tp = tcp_sk(sk);
        struct tcp_skb_cb *tcb = TCP_SKB_CB(skb);
 
-       skb->csum    = 0;
        tcb->seq     = tcb->end_seq = tp->write_seq;
        tcb->tcp_flags = TCPHDR_ACK;
        tcb->sacked  = 0;
index 7ecf35d..5664355 100644 (file)
@@ -2398,7 +2398,6 @@ static int tcp_mtu_probe(struct sock *sk)
        TCP_SKB_CB(nskb)->end_seq = TCP_SKB_CB(skb)->seq + probe_size;
        TCP_SKB_CB(nskb)->tcp_flags = TCPHDR_ACK;
        TCP_SKB_CB(nskb)->sacked = 0;
-       nskb->csum = 0;
 
        tcp_insert_write_queue_before(nskb, skb, sk);
        tcp_highest_sack_replace(sk, skb, nskb);
index c678e77..2cc9b0e 100644 (file)
@@ -969,7 +969,6 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32
        fl6.flowlabel = label;
 
        buff->ip_summed = CHECKSUM_PARTIAL;
-       buff->csum = 0;
 
        __tcp_v6_send_check(buff, &fl6.saddr, &fl6.daddr);