diff --git a/pimd/pim_nb_config.c b/pimd/pim_nb_config.c index 3c4ab1d4cc..d7e4154558 100644 --- a/pimd/pim_nb_config.c +++ b/pimd/pim_nb_config.c @@ -81,15 +81,17 @@ static void pim_if_membership_refresh(struct interface *ifp) pim_ifp = ifp->info; assert(pim_ifp); -#if PIM_IPV == 6 - gm_ifp = pim_ifp->mld; -#endif if (!pim_ifp->pim_enable) return; if (!pim_ifp->gm_enable) return; +#if PIM_IPV == 6 + gm_ifp = pim_ifp->mld; + if (!gm_ifp) + return; +#endif /* * First clear off membership from all PIM (S,G) entries on the * interface