casaroli commented on code in PR #21246:
URL: https://github.com/apache/nuttx/pull/21246#discussion_r4435094349
##########
net/mld/mld_group.c:
##########
@@ -118,6 +118,10 @@ FAR struct mld_group_s *mld_grpalloc(FAR struct
net_driver_s *dev,
net_ipv6addr_copy(group->grpaddr, addr);
nxsem_init(&group->sem, 0, 0);
+ /* Initialize the number of joins to 1 */
+
+ group->njoins = 1;
Review Comment:
mld_grpalloc() is also called by mld_grpallocfind() from mld_report() under
CONFIG_NET_MLD_ROUTER, for a group that another node reported and this host has
not joined. mld_joingroup() relies on njoins == 0 there to run
mld_group_startup() for the first local join (mld_join.c:205-221). With njoins
= 1 the startup is skipped, and after the last local leave njoins stays 1, so
no Done is sent and the group is never freed.
Fix: keep njoins = 0 in mld_grpalloc() and the assignment in
mld_joingroup(), and set njoins = 1 for the all-nodes group in mld_devinit().
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]