Skip to content

Commit 1b22bca

Browse files
Jon Maloydavem330
authored andcommitted
tipc: correct initial value for group congestion flag
In commit 60c2530 ("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: 60c2530 ("tipc: fix race between poll() and setsockopt()") Reported-by: Hoang Le <[email protected]> Signed-off-by: Jon Maloy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 3d18e4f commit 1b22bca

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

net/tipc/group.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ struct tipc_group *tipc_group_create(struct net *net, u32 portid,
189189
grp->loopback = mreq->flags & TIPC_GROUP_LOOPBACK;
190190
grp->events = mreq->flags & TIPC_GROUP_MEMBER_EVTS;
191191
grp->open = group_is_open;
192+
*grp->open = false;
192193
filter |= global ? TIPC_SUB_CLUSTER_SCOPE : TIPC_SUB_NODE_SCOPE;
193194
if (tipc_topsrv_kern_subscr(net, portid, type, 0, ~0,
194195
filter, &grp->subid))

net/tipc/socket.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,7 @@ static int tipc_sk_create(struct net *net, struct socket *sock,
473473
sk->sk_write_space = tipc_write_space;
474474
sk->sk_destruct = tipc_sock_destruct;
475475
tsk->conn_timeout = CONN_TIMEOUT_DEFAULT;
476+
tsk->group_is_open = true;
476477
atomic_set(&tsk->dupl_rcvcnt, 0);
477478

478479
/* Start out with safe limits until we receive an advertised window */

0 commit comments

Comments
 (0)