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)
commit517d7c79bdb39864e617960504bdc1aa560c75c6
treef850757a09157847c5d04364b7d19df3c7ac7762
parent1528f6e2764c483b9ba1df315d771b2d41b11a04
tipc: fix hanging poll() for stream sockets

In commit 42b531de17d2f6 ("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: 42b531de17d2f6 ("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