net/mld/mld_group.c: Fixed failure to stop queries. This turned out to be an uninitialized variable. I wonder why there was no warning from GCC?

This commit is contained in:
Gregory Nutt 2018-11-11 15:25:16 -06:00
parent 610c187e96
commit 9b1025ca1b
2 changed files with 8 additions and 11 deletions

View file

@ -75,7 +75,7 @@
static int mld_ngroups(FAR struct net_driver_s *dev)
{
FAR struct mld_group_s *group;
int ngroups;
int ngroups = 0;
/* Count the number of groups in the group list */
@ -274,9 +274,6 @@ void mld_grpfree(FAR struct net_driver_s *dev, FAR struct mld_group_s *group)
#ifndef CONFIG_CONFIG_NET_MLD_ROUTER
/* If there are no longer any groups, then stop the general query and v1
* compatibility timers.
*
* REVISIT: Does not work. Continues to query after the last group
* leaves.
*/
if (mld_ngroups(dev) < 1)

View file

@ -196,15 +196,15 @@ int mld_leavegroup(FAR const struct ipv6_mreq *mrec)
CLR_MLD_SCHEDMSG(group->flags);
CLR_MLD_WAITMSG(group->flags);
/* Free the group structure */
/* Free the group structure */
mld_grpfree(dev, group);
mld_grpfree(dev, group);
/* REVISIT: It is expected that higher level logic will remove
* the routing table entry for the old multicast address. That
* is not done here.
*/
}
/* REVISIT: It is expected that higher level logic will remove
* the routing table entry for the old multicast address. That
* is not done here.
*/
}
}
return OK;