In case when application doesn't process accepting of connections fast enough, I am seeing weird behavior of socket accept(). So if data arrived and then FIN before application accept, accept can return ECONNABORTED and flush unread valid data. That is inconsistent with normal TCP semantics where data before FIN should still be readable. A safer behavior is to let accept succeed when queued payload exists, and only treat it as aborted when there is truly no readable data (or a real error/RST condition).
What do you think about that?
This is the beginning of code that causes the issue, line 553 - 564: https://github.com/zephyrproject-rtos/zephyr/blob/1028e6588b2ad64f16bce66a6f3c5c00aa75fab5/subsys/net/lib/sockets/sockets_inet.c#L553