nuttx/net/tcp
YAMAMOTO Takashi 08e9dff0e9 tcp_close: disable send callback before sending FIN
This fixes connection closing issues with CONFIG_NET_TCP_WRITE_BUFFERS.

Because TCP_CLOSE is used for both of input and output for tcp_callback,
the close callback and the send callback confuses each other as
the following. As it effectively disposes the connection immediately,
we end up with responding to the consequent ACK and FIN/ACK from the peer
with RSTs.

tcp_timer
    -> tcp_close_eventhandler
        returns TCP_CLOSE (meaning an active close)
    -> psock_send_eventhandler
        called with TCP_CLOSE from tcp_close_eventhandler, misinterpet as
        a passive close.
        -> tcp_lost_connection
            -> tcp_shutdown_monitor
                -> tcp_callback
                    -> tcp_close_eventhandler
                        misinterpret TCP_CLOSE from itself as
                        a passive close
2021-06-30 06:39:13 -05:00
..
Kconfig net/tcp: implement the fast retransmit 2020-12-01 11:36:10 -06:00
Make.defs net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_accept.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_appsend.c tcp: window update improvements 2021-06-13 21:20:24 -05:00
tcp_backlog.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_callback.c tcp: simplify readahead 2021-06-30 06:22:14 +09:00
tcp_close.c tcp_close: disable send callback before sending FIN 2021-06-30 06:39:13 -05:00
tcp_conn.c tcp_close: replace scaring comments 2021-06-30 06:39:13 -05:00
tcp_connect.c net/tcp/handshake: send the SYN immediately. 2020-12-18 14:16:11 +09:00
tcp_devpoll.c Standardization of some function headers. 2018-03-13 09:52:27 -06:00
tcp_finddev.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_getsockopt.c net/tcp: set/get TCP_KEEPINTVL/IDLE value as BSD style 2021-05-22 09:01:18 -05:00
tcp_input.c tcp: always responds to keep-alive segments 2021-06-30 11:52:08 +09:00
tcp_ipselect.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_listen.c Run codespell -w with the latest dictonary again 2020-02-23 22:27:46 +01:00
tcp_monitor.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_netpoll.c tcp: simplify readahead 2021-06-30 06:22:14 +09:00
tcp_notifier.c tcp: simplify readahead 2021-06-30 06:22:14 +09:00
tcp_recvfrom.c tcp: simplify readahead 2021-06-30 06:22:14 +09:00
tcp_recvwindow.c tcp: simplify readahead 2021-06-30 06:22:14 +09:00
tcp_send_buffered.c tcp: Use the tcp seq macros in some obvious places 2021-06-10 22:47:04 -05:00
tcp_send_unbuffered.c tcp: Use the tcp seq macros in some obvious places 2021-06-10 22:47:04 -05:00
tcp_send.c tcp_reset: Don't copy the peer window 2021-06-29 22:23:48 -05:00
tcp_sendfile.c Include assert.h in necessary place 2021-06-08 13:06:08 -07:00
tcp_seqno.c net/: Fix alignment and spacing problems found by tools/nxstyle. 2019-07-02 18:02:23 -06:00
tcp_setsockopt.c net/tcp: set/get TCP_KEEPINTVL/IDLE value as BSD style 2021-05-22 09:01:18 -05:00
tcp_timer.c net/tcp: reset the connection ref count before tcp_free() 2021-03-22 10:55:30 +09:00
tcp_txdrain.c sched: Don't include nuttx/sched.h inside sched.h 2021-05-24 12:11:53 +09:00
tcp_wrbuffer_dump.c net: Author Gregory Nutt: update licenses to Apache 2021-02-20 00:38:18 -08:00
tcp_wrbuffer.c net: update licenses to Apache 2021-05-27 08:07:25 +09:00
tcp.h tcp: simplify readahead 2021-06-30 06:22:14 +09:00