net: tcp: Do not accept new data in retransmission mode
When TCP stack enters retransmission mode, the variable tracking the amount of unacknowledged data is cleared. This prevents the stack from detecting when TX window is full, which could lead to queueing unlimited amount of data, effectively consuming all of the avaiable network buffers. Prevent this, by returning early from net_tcp_queue_data() in case TCP stack is in retransmission mode. The socket layer will take care of retrying just as in case the window is full. Signed-off-by: Robert Lubos <robert.lubos@nordicsemi.no>
This commit is contained in:
parent
2e9866f88f
commit
0088aaefa0
1 changed files with 5 additions and 0 deletions
|
@ -2236,6 +2236,11 @@ int net_tcp_queue_data(struct net_context *context, struct net_pkt *pkt)
|
|||
goto out;
|
||||
}
|
||||
|
||||
if (conn->data_mode == TCP_DATA_MODE_RESEND) {
|
||||
ret = -EAGAIN;
|
||||
goto out;
|
||||
}
|
||||
|
||||
len = net_pkt_get_len(pkt);
|
||||
|
||||
if (conn->send_data->buffer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue