]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: fix hanging poll() for stream sockets
authorParthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
Thu, 28 Dec 2017 11:03:06 +0000 (12:03 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Dec 2017 17:15:26 +0000 (12:15 -0500)
commita8d03520d3c7b1a58677bddbf1a08111c128b3dd
treef850757a09157847c5d04364b7d19df3c7ac7762
parentc232e82b0f2383f38105b3d2f27686675bc515d6
tipc: fix hanging poll() for stream sockets

In commit 68b0374b27b28c ("tipc: Fix missing connection request
handling"), we replaced unconditional wakeup() with condtional
wakeup for clients with flags POLLIN | POLLRDNORM | POLLRDBAND.

This breaks the applications which do a connect followed by poll
with POLLOUT flag. These applications are not woken when the
connection is ESTABLISHED and hence sleep forever.

In this commit, we fix it by including the POLLOUT event for
sockets in TIPC_CONNECTING state.

Fixes: 68b0374b27b28c ("tipc: Fix missing connection request handling")
Acked-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: Parthasarathy Bhuvaragan <parthasarathy.bhuvaragan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/socket.c