Skip to content
Commit e3b8fad9 authored by Sjors Hettinga's avatar Sjors Hettinga Committed by Carles Cufí
Browse files

net: tcp: Fix accidental removal of data from send_data



In the function net_tcp_queue_data. When an -ENOBUFS by
tcp_send_queued_data is returned, it throws away the whole block of size
len from the send_data. If the len is > MSS, it could happen that the
first section is transmitted, but at the second an -ENOBUFS occurs.
In that case the data is transmitted, but later on removed from the
send_data.

To circumvent this problem, check if the len + unacked_len is smaller
then the send_data_total. If so, the data can safely be removed from
send_data. Otherwise, just pretend the transmission went OK. The
acknowledgment and retransmit path will eventually take care of it.

Signed-off-by: default avatarSjors Hettinga <s.a.hettinga@gmail.com>
parent ebf8b6d3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment