Skip to content

net: tcp: Use correct seqnum for tcp_out and tcp_out_ext #90636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions subsys/net/ip/tcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1618,7 +1618,7 @@ static int tcp_out_ext(struct tcp *conn, uint8_t flags, struct net_pkt *data,

static void tcp_out(struct tcp *conn, uint8_t flags)
{
(void)tcp_out_ext(conn, flags, NULL /* no data */, conn->seq);
(void)tcp_out_ext(conn, flags, NULL /* no data */, conn->seq + conn->unacked_len);
}

static int tcp_pkt_pull(struct net_pkt *pkt, size_t len)
Expand Down Expand Up @@ -2039,8 +2039,7 @@ static void tcp_send_keepalive_probe(struct k_work *work)
k_work_reschedule_for_queue(&tcp_work_q, &conn->keepalive_timer,
K_SECONDS(conn->keep_intvl));


(void)tcp_out_ext(conn, ACK, NULL, conn->seq - 1);
(void)tcp_out_ext(conn, ACK, NULL, conn->seq + conn->unacked_len - 1);
}
#endif /* CONFIG_NET_TCP_KEEPALIVE */

Expand All @@ -2051,7 +2050,7 @@ static void tcp_send_zwp(struct k_work *work)

k_mutex_lock(&conn->lock, K_FOREVER);

(void)tcp_out_ext(conn, ACK, NULL, conn->seq - 1);
(void)tcp_out_ext(conn, ACK, NULL, conn->seq + conn->unacked_len - 1);

tcp_derive_rto(conn);

Expand Down
Loading