From 0bc327f7b45dbb5bbc21ebdf4e546de2761821cb Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Mon, 8 Aug 2016 09:37:51 -0400 Subject: [PATCH] pimd: Fix some SA issues SA found these two issues: 1) Check of ifp non-null caused other non-checks down code to assume ifp could be null. This is not the case. If we get a callback at this point we must have a valid ifp pointer. 2) We were inadvertently calling igmp_source_reset_gmi with a possible NULL source pointer. Signed-off-by: Donald Sharp --- pimd/pim_igmpv3.c | 6 ++++-- pimd/pim_mroute.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pimd/pim_igmpv3.c b/pimd/pim_igmpv3.c index 149d18df54..ba75fc221f 100644 --- a/pimd/pim_igmpv3.c +++ b/pimd/pim_igmpv3.c @@ -647,8 +647,10 @@ static void isex_excl(struct igmp_group *group, struct in_addr star = { .s_addr = INADDR_ANY }; source = igmp_find_source_by_addr (group, star); if (source) - IGMP_SOURCE_DONT_DELETE(source->source_flags); - igmp_source_reset_gmi (group->group_igmp_sock, group, source); + { + IGMP_SOURCE_DONT_DELETE(source->source_flags); + igmp_source_reset_gmi (group->group_igmp_sock, group, source); + } } /* E.5: delete all sources marked with deletion flag: (X-A) and (Y-A) */ diff --git a/pimd/pim_mroute.c b/pimd/pim_mroute.c index 31ca10b6b6..d875926871 100644 --- a/pimd/pim_mroute.c +++ b/pimd/pim_mroute.c @@ -353,7 +353,7 @@ int pim_mroute_msg(int fd, const char *buf, int buf_size) fd, src_str, grp_str, - ifp ? ifp->name : "", + ifp->name, msg->im_vif); } -- 2.39.5