Skip to content

Commit 9866884

Browse files
Ilpo Järvinendavem330
Ilpo Järvinen
authored andcommitted
tcp: Pass flags to __tcp_send_ack
Accurate ECN needs to send custom flags to handle IP-ECN field reflection during handshake. Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: Chia-Yu Chang <[email protected]> Reviewed-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 4618e19 commit 9866884

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/net/tcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority,
707707
enum sk_rst_reason reason);
708708
int tcp_send_synack(struct sock *);
709709
void tcp_push_one(struct sock *, unsigned int mss_now);
710-
void __tcp_send_ack(struct sock *sk, u32 rcv_nxt);
710+
void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags);
711711
void tcp_send_ack(struct sock *sk);
712712
void tcp_send_delayed_ack(struct sock *sk);
713713
void tcp_send_loss_probe(struct sock *sk);

net/ipv4/bpf_tcp_ca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log,
121121
BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt)
122122
{
123123
/* bpf_tcp_ca prog cannot have NULL tp */
124-
__tcp_send_ack((struct sock *)tp, rcv_nxt);
124+
__tcp_send_ack((struct sock *)tp, rcv_nxt, 0);
125125
return 0;
126126
}
127127

net/ipv4/tcp_dctcp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static inline void dctcp_ece_ack_update(struct sock *sk, enum tcp_ca_event evt,
2828
*/
2929
if (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) {
3030
dctcp_ece_ack_cwr(sk, *ce_state);
31-
__tcp_send_ack(sk, *prior_rcv_nxt);
31+
__tcp_send_ack(sk, *prior_rcv_nxt, 0);
3232
}
3333
inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW;
3434
}

net/ipv4/tcp_output.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,7 +4240,7 @@ void tcp_send_delayed_ack(struct sock *sk)
42404240
}
42414241

42424242
/* This routine sends an ack and also updates the window. */
4243-
void __tcp_send_ack(struct sock *sk, u32 rcv_nxt)
4243+
void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags)
42444244
{
42454245
struct sk_buff *buff;
42464246

@@ -4269,7 +4269,7 @@ void __tcp_send_ack(struct sock *sk, u32 rcv_nxt)
42694269

42704270
/* Reserve space for headers and prepare control bits. */
42714271
skb_reserve(buff, MAX_TCP_HEADER);
4272-
tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK);
4272+
tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK | flags);
42734273

42744274
/* We do not want pure acks influencing TCP Small Queues or fq/pacing
42754275
* too much.
@@ -4284,7 +4284,7 @@ EXPORT_SYMBOL_GPL(__tcp_send_ack);
42844284

42854285
void tcp_send_ack(struct sock *sk)
42864286
{
4287-
__tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt);
4287+
__tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt, 0);
42884288
}
42894289

42904290
/* This routine sends a packet with an out of date sequence

0 commit comments

Comments
 (0)