aboutsummaryrefslogtreecommitdiffstats
path: root/net/tipc
diff options
context:
space:
mode:
authorJon Maloy <jon.maloy@ericsson.com>2017-12-18 14:03:05 -0500
committerDavid S. Miller <davem@davemloft.net>2017-12-19 14:10:03 -0500
commit3db096011722fd8717e57687ae94b6917a11c9cc (patch)
tree1bb0c5a3fe51577436b8462ed052025c17bad27d /net/tipc
parentc9fefa08190fc879fb2e681035d7774e0a8c5170 (diff)
tipc: fix list sorting bug in function tipc_group_update_member()
When, during a join operation, or during message transmission, a group member needs to be added to the group's 'congested' list, we sort it into the list in ascending order, according to its current advertised window size. However, we miss the case when the member is already on that list. This will have the result that the member, after the window size has been decremented, might be at the wrong position in that list. This again may have the effect that we during broadcast and multicast transmissions miss the fact that a destination is not yet ready for reception, and we end up sending anyway. From this point on, the behavior during the remaining session is unpredictable, e.g., with underflowing window sizes. We now correct this bug by unconditionally removing the member from the list before (re-)sorting it in. Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r--net/tipc/group.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/net/tipc/group.c b/net/tipc/group.c
index b96ec429bb9b..bbc004eaa31a 100644
--- a/net/tipc/group.c
+++ b/net/tipc/group.c
@@ -351,8 +351,7 @@ void tipc_group_update_member(struct tipc_member *m, int len)
351 if (m->window >= ADV_IDLE) 351 if (m->window >= ADV_IDLE)
352 return; 352 return;
353 353
354 if (!list_empty(&m->congested)) 354 list_del_init(&m->congested);
355 return;
356 355
357 /* Sort member into congested members' list */ 356 /* Sort member into congested members' list */
358 list_for_each_entry_safe(_m, tmp, &grp->congested, congested) { 357 list_for_each_entry_safe(_m, tmp, &grp->congested, congested) {