Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AC1883793BF for ; Sun, 9 Aug 2026 13:54:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786283690; cv=none; b=dnJOTgCYGtq67Nz/IqDf95Tt4iGRwhSsOz151SdXSgq5ETt3rb78/4F/4LUi2U9B32BTM9IjQhuxo+4W4LhubVHG7DxTTxX2dd7jjAEKHmeVBDIMez3el021TVX31DM5dGiytZzWPhJQvbweNb04Z5y6+0jI1ICwkNuMZyK+X7M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786283690; c=relaxed/simple; bh=TM4APS3+1JY39rhUe9UyX2KjNIynRQRrleB55ZS58EA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=oGGt7YxYMFdF2gHceJLZPjpgLL7HhIYF0Uzlrg4c+fo0k66JoKTjt/fIGSPrn0a2yqa3dKGtsSexGdW/9eesSt2CHd/ziVJ0OlgqSuzudGpAiJzCmRG6y39/qKn21HflZUZQSsj2Ed7wxtVFEqS6fZ28mCELq9Qx5DxV6om+ihs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UDcrn6Ep; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UDcrn6Ep" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80BF11F000E9; Sun, 9 Aug 2026 13:54:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786283688; bh=dpHvhrnhtx1xcq6M2jIvP7sZT/pq4zEA1EhTwR2TaoY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UDcrn6EpKc0T3YRT40xzAa3xWaBmvnOVAkJWf9wWQH6oUloGzJ7uAICPZqEIcTuzq fabkIjizykbDvyu8mfyr38hJRCvWxsRLDM8TYmisnThGS2d/V7BmUOHe+EDPg3Ento 9hpjByXl7UbkrBqwmkau5reqFna893XRtnKVQ5ClXeY1hr83uQqiKwS+lxO/abhqgV UDC8wzVJNcAhriW2QV0TOjdTk7IyGaOKwBjZWa86lPr+eT+bDI2yED094WpFaw+0Di M/wO9cgAYM2n0pbUxNMRqwe6t3EVC/DgYrbNqeNFdYUcVXOolYrr7+fB7z1qXQ8B7L RiP+E7vaOyO+Q== From: Sasha Levin To: stable@vger.kernel.org Cc: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , Chia-Yu Chang , Eric Dumazet , "David S. Miller" , Sasha Levin Subject: [PATCH 6.6.y 1/3] tcp: Pass flags to __tcp_send_ack Date: Sun, 9 Aug 2026 09:54:43 -0400 Message-ID: <20260809135445.1507611-1-sashal@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <2026072945-service-serpent-1ee6@gregkh> References: <2026072945-service-serpent-1ee6@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Ilpo Järvinen [ Upstream commit 9866884ce8ef25338c5b33cbb97c2b5d92088528 ] Accurate ECN needs to send custom flags to handle IP-ECN field reflection during handshake. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang Reviewed-by: Eric Dumazet Signed-off-by: David S. Miller Stable-dep-of: a28c4fcbf774 ("tcp: challenge ACK for non-exact RST in SYN-RECEIVED") Signed-off-by: Sasha Levin --- include/net/tcp.h | 2 +- net/ipv4/bpf_tcp_ca.c | 2 +- net/ipv4/tcp_dctcp.h | 2 +- net/ipv4/tcp_output.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index a6def0aab3ed3..4ce70767474f3 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -614,7 +614,7 @@ void tcp_send_fin(struct sock *sk); void tcp_send_active_reset(struct sock *sk, gfp_t priority); int tcp_send_synack(struct sock *); void tcp_push_one(struct sock *, unsigned int mss_now); -void __tcp_send_ack(struct sock *sk, u32 rcv_nxt); +void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags); void tcp_send_ack(struct sock *sk); void tcp_send_delayed_ack(struct sock *sk); void tcp_send_loss_probe(struct sock *sk); diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c index 39dcccf0f174b..af29b75fc4860 100644 --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c @@ -128,7 +128,7 @@ static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log, BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt) { /* bpf_tcp_ca prog cannot have NULL tp */ - __tcp_send_ack((struct sock *)tp, rcv_nxt); + __tcp_send_ack((struct sock *)tp, rcv_nxt, 0); return 0; } diff --git a/net/ipv4/tcp_dctcp.h b/net/ipv4/tcp_dctcp.h index d69a77cbd0c75..4b0259111d816 100644 --- a/net/ipv4/tcp_dctcp.h +++ b/net/ipv4/tcp_dctcp.h @@ -28,7 +28,7 @@ static inline void dctcp_ece_ack_update(struct sock *sk, enum tcp_ca_event evt, */ if (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) { dctcp_ece_ack_cwr(sk, *ce_state); - __tcp_send_ack(sk, *prior_rcv_nxt); + __tcp_send_ack(sk, *prior_rcv_nxt, 0); } inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW; } diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index c66fede62fa8d..5abad93d3c743 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -4098,7 +4098,7 @@ void tcp_send_delayed_ack(struct sock *sk) } /* This routine sends an ack and also updates the window. */ -void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) +void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags) { struct sk_buff *buff; @@ -4127,7 +4127,7 @@ void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) /* Reserve space for headers and prepare control bits. */ skb_reserve(buff, MAX_TCP_HEADER); - tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK); + tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK | flags); /* We do not want pure acks influencing TCP Small Queues or fq/pacing * too much. @@ -4142,7 +4142,7 @@ EXPORT_SYMBOL_GPL(__tcp_send_ack); void tcp_send_ack(struct sock *sk) { - __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); + __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt, 0); } /* This routine sends a packet with an out of date sequence -- 2.53.0