summaryrefslogtreecommitdiff
path: root/pimd/pim_igmpv3.c
diff options
context:
space:
mode:
authorJafar Al-Gharaibeh <jafar@atcorp.com>2021-08-25 11:20:22 -0500
committerJafar Al-Gharaibeh <jafar@atcorp.com>2021-08-25 15:10:32 -0500
commit26d0cbbb76905bcdb88f05e8fa55f5659ef9e524 (patch)
tree468420f3e280dc0762534696c45da7d4674c70dc /pimd/pim_igmpv3.c
parentb9d23ca0bb95ccec3126e5d57f54844de8b59b06 (diff)
pimd: fix coverity/dead-code issue
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
Diffstat (limited to 'pimd/pim_igmpv3.c')
-rw-r--r--pimd/pim_igmpv3.c25
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,