From: Erik H. <eri...@er...> - 2012-06-01 11:08:53
|
If an implied connect is attempted during link congestion, the connect message will be discarded and sendmsg will return EAGAIN. The application then need to retry the connection attempt after congestion have abated. This fixes a problem where polling on a socket in an unconnected state always returned a zero mask. Signed-off-by: Erik Hugne <eri...@er...> --- net/tipc/socket.c | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 03a2610..7710145 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -407,7 +407,7 @@ static int get_name(struct socket *sock, struct sockaddr *uaddr, * socket state flags set * ------------ --------- * unconnected no read flags - * no write flags + * POLLOUT if port is not congested * * connecting POLLIN/POLLRDNORM if ACK/NACK in rx queue * no write flags @@ -437,6 +437,10 @@ static unsigned int poll(struct file *file, struct socket *sock, poll_wait(file, sk_sleep(sk), wait); switch ((int)sock->state) { + case SS_UNCONNECTED: + if (!tipc_sk_port(sk)->congested) + mask |= POLLOUT; + break; case SS_READY: case SS_CONNECTED: if (!tipc_sk_port(sk)->congested) -- 1.7.5.4 |