]> git.baikalelectronics.ru Git - kernel.git/commit
tipc: correct initial value for group congestion flag
authorJon Maloy <jon.maloy@ericsson.com>
Mon, 26 Feb 2018 19:14:04 +0000 (20:14 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 27 Feb 2018 16:46:03 +0000 (11:46 -0500)
commit47a70b689837a3e826aacea67101f6e3e92f0545
treea89ec297430075d8a6a90ac6aa088d7b15744642
parentf87da49f4e83722cfd6187a46224f7a369087951
tipc: correct initial value for group congestion flag

In commit 89f9a40b26c0 ("tipc: fix race between poll() and
setsockopt()") we introduced a pointer from struct tipc_group to the
'group_is_connected' flag in struct tipc_sock, so that this field can
be checked without dereferencing the group pointer of the latter struct.

The initial value for this flag is correctly set to 'false' when a
group is created, but we miss the case when no group is created at
all, in which case the initial value should be 'true'. This has the
effect that SOCK_RDM/DGRAM sockets sending datagrams never receive
POLLOUT if they request so.

This commit corrects this bug.

Fixes: 89f9a40b26c0 ("tipc: fix race between poll() and setsockopt()")
Reported-by: Hoang Le <hoang.h.le@dektek.com.au>
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/group.c
net/tipc/socket.c