On Thu, 2015-11-19 at 14:14 -0800, Tom Herbert wrote: > On Thu, Nov 19, 2015 at 2:07 PM, Eric Dumazet <eric.duma...@gmail.com> wrote: > > On Thu, 2015-11-19 at 13:53 -0800, Tom Herbert wrote: > > > >> That covers the case where the local address is removed, but the not > >> the case where the network manager is informed of an error in the path > >> and wants to signal the application. My understanding was that > >> SIOCKILLADDR would work for the first case, but this patch was need to > >> cover the second case. > >> > >> btw, instead of closing the TCP socket can we just report an error and > >> wake up the application without affecting the connection? That is this > >> just becomes an error on the socket. The response by the application > >> will be the same in any case, porbablly just close the socket and try > >> to reestablish the connection. > > > > I thought this was the patch intent ? > > > > Application gets a EPOLLIN|EPOLLOUT|POLLERR notification (if it is > > willing to receive it, or blocked in a socket syscall) and closes the > > socket. > > > > sk->sk_err = ETIMEDOUT; > > sk->sk_error_report(sk); > > tcp_done(sk); > > > The tcp_done is not needed here. This is the difference between the > application having the connection closed underneath them, versus the > application performing a close to terminate the connection. The latter > behavior preserves the semantics that only the stack or the > application owning the socket can initiate a state change on the > connection.
The code behaves like we received a formal RST : Please do not even bother trying to send additional data, it is not worth wasting precious resource. There is currently no system call telling the stack : Please remove all outstanding data for this socket. And even if it was present, how many applications need to be changed, because all they do is probably a close(), after a shutdown() if they really were cautious... -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html