diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2021-08-26 11:06:15 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-26 11:06:15 -0400 |
| commit | a594fc56829eecf60bedcb763b8d5962432b4c32 (patch) | |
| tree | 0e9cea543daac44f0e673f33bb6020839dd43d32 | |
| parent | db2ab4dd2cd95575be6b7ebac2ab1ad78a5dc7ae (diff) | |
| parent | 26d0cbbb76905bcdb88f05e8fa55f5659ef9e524 (diff) | |
Merge pull request #9492 from Jafaral/pim-cov
pimd: fix coverity/dead-code issue
| -rw-r--r-- | pimd/pim_igmpv3.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 572d3a6aba..bc67a1dd1d 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -509,8 +509,22 @@ static void allow(struct igmp_sock *igmp, struct in_addr from, So, deleting the group present. */ group = find_group_by_addr(igmp, group_addr); - if (group && (group->group_filtermode_isexcl == 0)) + if (!group) { + return; + } + if (group->group_filtermode_isexcl) { + if (listcount(group->group_source_list) == 1) { + struct in_addr star = {.s_addr = INADDR_ANY}; + + source = igmp_find_source_by_addr(group, star); + if (source) + igmp_source_reset_gmi(igmp, group, + source); + } + } else { igmp_group_delete(group); + } + return; } @@ -544,15 +558,6 @@ static void allow(struct igmp_sock *igmp, struct in_addr from, igmp_source_reset_gmi(igmp, group, source); } /* scan received sources */ - - if ((num_sources == 0) && (group->group_filtermode_isexcl) - && (listcount(group->group_source_list) == 1)) { - struct in_addr star = {.s_addr = INADDR_ANY}; - - source = igmp_find_source_by_addr(group, star); - if (source) - igmp_source_reset_gmi(igmp, group, source); - } } void igmpv3_report_isin(struct igmp_sock *igmp, struct in_addr from, |
