From 5e15125b3df98ece8910ff1d8ec739bb8f391922 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Sun, 2 Oct 2016 20:50:32 +0800 Subject: [PATCH] igmp: Fix optimized code by always skipping the first entry in the linked groups list commit 8c52afb6ca21 ("igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry") accidently changes the code logic. it should check groupref rather than group. Signed-off-by: Axel Lin --- src/core/ipv4/igmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ipv4/igmp.c b/src/core/ipv4/igmp.c index 79ba690d..d8e8f9c2 100644 --- a/src/core/ipv4/igmp.c +++ b/src/core/ipv4/igmp.c @@ -374,8 +374,8 @@ igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest) /* Do not send messages on the all systems group address! */ /* Skip the first group in the list, it is always the allsystems group added in igmp_start() */ - if(group != NULL) { - group = group->next; + if(groupref != NULL) { + groupref = groupref->next; } while (groupref) {