net: tcp: Only do ref when resending if we could send the packet
If the packet sending is slow then we must NOT increment the ref count when re-sending it. This is unlikely but can happen if there are lot of debug prints etc. extra activities that prevent the driver to actually send the packet fast enough. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
f8ea1a59ea
commit
cdec73d21e
1 changed files with 4 additions and 1 deletions
|
@ -185,7 +185,10 @@ static void tcp_retry_expired(struct k_timer *timer)
|
|||
pkt = CONTAINER_OF(sys_slist_peek_head(&tcp->sent_list),
|
||||
struct net_pkt, sent_list);
|
||||
|
||||
do_ref_if_needed(tcp, pkt);
|
||||
if (net_pkt_sent(pkt)) {
|
||||
do_ref_if_needed(tcp, pkt);
|
||||
net_pkt_set_sent(pkt, false);
|
||||
}
|
||||
|
||||
if (net_tcp_send_pkt(pkt) < 0 && !is_6lo_technology(pkt)) {
|
||||
NET_DBG("[%p] pkt %p send failed", tcp, pkt);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue