]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: improve error validations for sockets in CONNECTING state
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Wed, 26 Apr 2017 08:05:01 +0000 (10:05 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 28 Apr 2017 16:20:42 +0000 (12:20 -0400)
commitc324f537378f21b7bffefa0f475a74e60ec19bdc
tree695516ff85fe9a7a30f99f5abda5ce1efd98da5d
parent68b0374b27b28c6a0dbd51e2a1388bde5c465eb4
tipc: improve error validations for sockets in CONNECTING state

Until now, the checks for sockets in CONNECTING state was based on
the assumption that the incoming message was always from the
peer's accepted data socket.

However an application using a non-blocking socket sends an implicit
connect, this socket which is in CONNECTING state can receive error
messages from the peer's listening socket. As we discard these
messages, the application socket hangs as there due to inactivity.
In addition to this, there are other places where we process errors
but do not notify the user.

In this commit, we process such incoming error messages and notify
our users about them using sk_state_change().

Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c