net: tcp: Simple zero window probe implementation
When peer reports a zero length receive window, the TCP stack block any outgoing data from being queued. In case no further ACK comes from the peer, the whole communication could stall. Fix this by sending a simple Zero Window Probe, when we detect a Zero Length Window. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
823ac60c70
commit
ce93fae60b
1 changed files with 4 additions and 0 deletions
|
@ -2193,6 +2193,10 @@ int net_tcp_queue_data(struct net_context *context, struct net_pkt *pkt)
|
||||||
k_mutex_lock(&conn->lock, K_FOREVER);
|
k_mutex_lock(&conn->lock, K_FOREVER);
|
||||||
|
|
||||||
if (tcp_window_full(conn)) {
|
if (tcp_window_full(conn)) {
|
||||||
|
if (conn->send_win == 0) {
|
||||||
|
tcp_out_ext(conn, ACK, NULL, conn->seq - 1);
|
||||||
|
}
|
||||||
|
|
||||||
/* Trigger resend if the timer is not active */
|
/* Trigger resend if the timer is not active */
|
||||||
/* TODO: use k_work_delayable for send_data_timer so we don't
|
/* TODO: use k_work_delayable for send_data_timer so we don't
|
||||||
* have to directly access the internals of the legacy object.
|
* have to directly access the internals of the legacy object.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue