net: tcp: send zero-window ACK when no memory
authorMenglong Dong <imagedong@tencent.com>
Fri, 11 Aug 2023 02:55:27 +0000 (10:55 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sun, 13 Aug 2023 11:21:37 +0000 (12:21 +0100)
commite2142825c120d4317abf7160a0fc34b3de532586
tree0689682aa43833ae1414c7b94557034b61ad2f48
parent3e6860ec3a2252249e310b0e6e88e2258171b3d0
net: tcp: send zero-window ACK when no memory

For now, skb will be dropped when no memory, which makes client keep
retrans util timeout and it's not friendly to the users.

In this patch, we reply an ACK with zero-window in this case to update
the snd_wnd of the sender to 0. Therefore, the sender won't timeout the
connection and will probe the zero-window with the retransmits.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/inet_connection_sock.h
net/ipv4/tcp_input.c
net/ipv4/tcp_output.c