Skip to content

Commit e36f67d

Browse files
pfalconjukkar
authored andcommitted
net: tcp: Remove incorrect logging of "ACK errors"
Case #1: If ACK received and our retransmit (i.e. unacked) queue is empty, it's error. It's incorrect because TCP requires ACK to set for every packet of established connection. For example, if we didn't send anything to peer, but it sends us new data, it will reuse the older ack number. It doesn't acknowledge anything new on our side, but it's not an error in any way. Case #2: If retransmit queue is only partially acknowledged, it's an error. Consider that we have 2 packets in the queue, with sequence numbers (inclusive) 100-199 and 200-399. There's nothing wrong if we receive ACK with number 200 - it just acknowledges first packet, we can remove and finish processing. Second packet remains in the queue to be acknowledged later. Fixes: zephyrproject-rtos#5504 Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
1 parent ac7b129 commit e36f67d

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

subsys/net/ip/tcp.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -920,11 +920,6 @@ bool net_tcp_ack_received(struct net_context *ctx, u32_t ack)
920920
return false;
921921
}
922922

923-
if (IS_ENABLED(CONFIG_NET_STATISTICS_TCP) &&
924-
sys_slist_is_empty(list)) {
925-
net_stats_update_tcp_seg_ackerr();
926-
}
927-
928923
while (!sys_slist_is_empty(list)) {
929924
struct net_tcp_hdr hdr, *tcp_hdr;
930925

@@ -945,7 +940,6 @@ bool net_tcp_ack_received(struct net_context *ctx, u32_t ack)
945940
seq = sys_get_be32(tcp_hdr->seq) + net_pkt_appdatalen(pkt) - 1;
946941

947942
if (!net_tcp_seq_greater(ack, seq)) {
948-
net_stats_update_tcp_seg_ackerr();
949943
break;
950944
}
951945

0 commit comments

Comments
 (0)