net/inet/inet_close.c: Last PR remove SO_LINGER socket option. SO_LINGER was always enabled is CONFIG_NET_SOLINGER was selected.
This commit is contained in:
parent
ed9fe70024
commit
5af5fc4409
21
TODO
21
TODO
@ -1,4 +1,4 @@
|
|||||||
NuttX TODO List (Last updated April 29, 2019)
|
NuttX TODO List (Last updated July 1, 2019)
|
||||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
This file summarizes known NuttX bugs, limitations, inconsistencies with
|
||||||
@ -19,7 +19,7 @@ nuttx/:
|
|||||||
(9) Kernel/Protected Build
|
(9) Kernel/Protected Build
|
||||||
(3) C++ Support
|
(3) C++ Support
|
||||||
(5) Binary loaders (binfmt/)
|
(5) Binary loaders (binfmt/)
|
||||||
(18) Network (net/, drivers/net)
|
(17) Network (net/, drivers/net)
|
||||||
(4) USB (drivers/usbdev, drivers/usbhost)
|
(4) USB (drivers/usbdev, drivers/usbhost)
|
||||||
(2) Other drivers (drivers/)
|
(2) Other drivers (drivers/)
|
||||||
(9) Libraries (libs/libc/, libs/libm/)
|
(9) Libraries (libs/libc/, libs/libm/)
|
||||||
@ -1653,23 +1653,6 @@ o Network (net/, drivers/net)
|
|||||||
before, so I suspect it might not be so prevalent as one
|
before, so I suspect it might not be so prevalent as one
|
||||||
might expect.
|
might expect.
|
||||||
|
|
||||||
Title: TCP SOCKETS CLOSED TOO QUICKLY
|
|
||||||
Description: When a socket is closed, the resources are torn down
|
|
||||||
immediately (unless the SO_LINGER option is selected). As a
|
|
||||||
result, the socket does not send the FIN and this looks like
|
|
||||||
an unexpected, abnormal loss of connection to the remote peer.
|
|
||||||
|
|
||||||
Actually, it is worse than this: The is NO logic to send
|
|
||||||
FIN in when the file is close. This is pretty easy to do,
|
|
||||||
however:
|
|
||||||
|
|
||||||
- Wait for a TCP poll, then
|
|
||||||
- Call tcp_append with TCP_CLOSE in the flags. There is
|
|
||||||
already logic in tcp_appsend to send the FIN in this case,
|
|
||||||
it is just not being use.
|
|
||||||
Status: Open
|
|
||||||
Priority: Medium-Low.
|
|
||||||
|
|
||||||
Title: LOCAL DATAGRAM RECVFROM RETURNS WRONG SENDER ADDRESS
|
Title: LOCAL DATAGRAM RECVFROM RETURNS WRONG SENDER ADDRESS
|
||||||
Description: The recvfrom logic for local datagram sockets returns the
|
Description: The recvfrom logic for local datagram sockets returns the
|
||||||
incorrect sender "from" address. Instead, it returns the
|
incorrect sender "from" address. Instead, it returns the
|
||||||
|
@ -213,7 +213,6 @@ static uint16_t tcp_close_eventhandler(FAR struct net_driver_s *dev,
|
|||||||
pstate->cl_result = -ETIMEDOUT;
|
pstate->cl_result = -ETIMEDOUT;
|
||||||
goto end_wait;
|
goto end_wait;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* CONFIG_NET_SOLINGER */
|
#endif /* CONFIG_NET_SOLINGER */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
#ifdef CONFIG_NET_TCP_WRITE_BUFFERS
|
||||||
@ -327,6 +326,7 @@ static inline int tcp_close_disconnect(FAR struct socket *psock)
|
|||||||
FAR struct tcp_conn_s *conn;
|
FAR struct tcp_conn_s *conn;
|
||||||
#ifdef CONFIG_NET_SOLINGER
|
#ifdef CONFIG_NET_SOLINGER
|
||||||
struct timespec abstime;
|
struct timespec abstime;
|
||||||
|
bool linger;
|
||||||
#endif
|
#endif
|
||||||
int ret = OK;
|
int ret = OK;
|
||||||
|
|
||||||
@ -400,6 +400,13 @@ static inline int tcp_close_disconnect(FAR struct socket *psock)
|
|||||||
/* Wait for the disconnect event */
|
/* Wait for the disconnect event */
|
||||||
|
|
||||||
#ifdef CONFIG_NET_SOLINGER
|
#ifdef CONFIG_NET_SOLINGER
|
||||||
|
/* A non-NULL value of the priv field means that lingering is
|
||||||
|
* enabled.
|
||||||
|
*/
|
||||||
|
|
||||||
|
linger = _SO_GETOPT(psock->s_options, SO_LINGER);
|
||||||
|
if (linger)
|
||||||
|
{
|
||||||
DEBUGVERIFY(clock_gettime(CLOCK_REALTIME, &abstime));
|
DEBUGVERIFY(clock_gettime(CLOCK_REALTIME, &abstime));
|
||||||
|
|
||||||
/* NOTE: s_linger's unit is deciseconds,
|
/* NOTE: s_linger's unit is deciseconds,
|
||||||
@ -412,9 +419,12 @@ static inline int tcp_close_disconnect(FAR struct socket *psock)
|
|||||||
{
|
{
|
||||||
state.cl_result = -ETIMEDOUT;
|
state.cl_result = -ETIMEDOUT;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
#else
|
#else
|
||||||
|
{
|
||||||
(void)net_timedwait(&state.cl_sem, NULL);
|
(void)net_timedwait(&state.cl_sem, NULL);
|
||||||
#endif
|
}
|
||||||
|
|
||||||
/* We are now disconnected */
|
/* We are now disconnected */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user