Skip to content

Commit 1eead93

Browse files
jukkarnashif
authored andcommitted
net: tcp: Do not mark TCP segment not sent in net_if
If the TCP segment is not sent properly by L2, then do not mark it "not sent" in net_if.c:net_if_tx(). That "not sent" marking confused TCP ref counting in tcp.c:tcp_retry_expired() and caused the packet to be freed too early which then caused free net_buf access issue during packet resend. This free memory access was seen with zperf sample application. From TCP point of view, the packet can be considered sent when it is given to L2. The TCP timer will resend the packet if needed. Fixes zephyrproject-rtos#15050 Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 30d3193 commit 1eead93

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

subsys/net/ip/net_if.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,6 @@ static bool net_if_tx(struct net_if *iface, struct net_pkt *pkt)
165165
}
166166

167167
if (status < 0) {
168-
if (IS_ENABLED(CONFIG_NET_TCP)
169-
&& net_pkt_family(pkt) != AF_UNSPEC) {
170-
net_pkt_set_sent(pkt, false);
171-
}
172-
173168
net_pkt_unref(pkt);
174169
} else {
175170
net_stats_update_bytes_sent(iface, status);

0 commit comments

Comments
 (0)