Skip to content

net: Incorrect logic for TCP "ackerr" statistics #5504

@pfalcon

Description

@pfalcon

In https://github.com/zephyrproject-rtos/zephyr/blob/master/subsys/net/ip/tcp.c#L907, we have the code like:

        if (IS_ENABLED(CONFIG_NET_STATISTICS_TCP) &&
            sys_slist_is_empty(list)) {
                net_stats_update_tcp_seg_ackerr();
        }

It means that if retransmit list is empty, then any ACK received will be considered "error". But that doesn't make sense, because TCP mandates ACK to be set for any packet of the established connection - if there's no advancement in the ack number, the last value will be used, and ACK bit still set.

Thus, the above condition should be removed. The (only?) condition for ACK being invalid is described in #4653 (comment) .

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions