mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-06 09:56:38 +00:00
igmp: Optimize code by always skipping the first entry in the linked groups list - it is always the "allsystems" entry
This commit is contained in:
parent
df5a79966d
commit
8c52afb6ca
@ -195,10 +195,13 @@ igmp_report_groups(struct netif *netif)
|
|||||||
|
|
||||||
LWIP_DEBUGF(IGMP_DEBUG, ("igmp_report_groups: sending IGMP reports on if %p\n", (void*)netif));
|
LWIP_DEBUGF(IGMP_DEBUG, ("igmp_report_groups: sending IGMP reports on if %p\n", (void*)netif));
|
||||||
|
|
||||||
while (group != NULL) {
|
/* Skip the first group in the list, it is always the allsystems group added in igmp_start() */
|
||||||
if (!(ip4_addr_cmp(&(group->group_address), &allsystems))) {
|
if(group != NULL) {
|
||||||
igmp_delaying_member(group, IGMP_JOIN_DELAYING_MEMBER_TMR);
|
group = group->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (group != NULL) {
|
||||||
|
igmp_delaying_member(group, IGMP_JOIN_DELAYING_MEMBER_TMR);
|
||||||
group = group->next;
|
group = group->next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -368,11 +371,15 @@ igmp_input(struct pbuf *p, struct netif *inp, const ip4_addr_t *dest)
|
|||||||
}
|
}
|
||||||
|
|
||||||
groupref = netif_igmp_data(inp);
|
groupref = netif_igmp_data(inp);
|
||||||
while (groupref) {
|
|
||||||
/* Do not send messages on the all systems group address! */
|
/* Do not send messages on the all systems group address! */
|
||||||
if (!(ip4_addr_cmp(&(groupref->group_address), &allsystems))) {
|
/* Skip the first group in the list, it is always the allsystems group added in igmp_start() */
|
||||||
igmp_delaying_member(groupref, igmp->igmp_maxresp);
|
if(group != NULL) {
|
||||||
|
group = group->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
while (groupref) {
|
||||||
|
igmp_delaying_member(groupref, igmp->igmp_maxresp);
|
||||||
groupref = groupref->next;
|
groupref = groupref->next;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user