mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-03-12 04:13:55 +00:00
igmp: Fix optimized code for igmp_remove_group
The code in the for loop checks tmp_group->next == group, so current code actually checks from the 3rd entry in the linked groups list. Fix it. Fixes: 5c1dd6a4c65b ("Optimization in igmp_remove_group() pointed out by Axel Lin") Signed-off-by: Axel Lin <axel.lin@ingics.com>
This commit is contained in:
parent
5c1dd6a4c6
commit
f488c5b7bc
@ -295,15 +295,10 @@ static err_t
|
||||
igmp_remove_group(struct netif* netif, struct igmp_group *group)
|
||||
{
|
||||
err_t err = ERR_OK;
|
||||
struct igmp_group *tmp_group = netif_igmp_data(netif);
|
||||
struct igmp_group *tmp_group;
|
||||
|
||||
/* Skip the first group in the list, it is always the allsystems group added in igmp_start() */
|
||||
if(tmp_group != NULL) {
|
||||
tmp_group = tmp_group->next;
|
||||
}
|
||||
|
||||
/* look for group further down the list */
|
||||
for (; tmp_group != NULL; tmp_group = tmp_group->next) {
|
||||
for (tmp_group = netif_igmp_data(netif); tmp_group != NULL; tmp_group = tmp_group->next) {
|
||||
if (tmp_group->next == group) {
|
||||
tmp_group->next = group->next;
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user