From cb35003fdca20dfd12e260891acc8d0ceef5c03e Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Thu, 16 Mar 2017 08:38:03 -0400 Subject: [PATCH] pimd: When the RPF is changed remove the group When changing the RPF cleanup the old entry in the J/P Agg neighbor list. Signed-off-by: Donald Sharp --- pimd/pim_nht.c | 6 ++++++ pimd/pim_upstream.c | 7 ------- pimd/pim_zebra.c | 7 +++++++ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/pimd/pim_nht.c b/pimd/pim_nht.c index c8cc187305..5fc5d08d16 100644 --- a/pimd/pim_nht.c +++ b/pimd/pim_nht.c @@ -370,6 +370,12 @@ pim_update_upstream_nh (struct pim_nexthop_cache *pnc) if (rpf_result == PIM_RPF_CHANGED) { + struct pim_neighbor *nbr; + + nbr = pim_neighbor_find (old.source_nexthop.interface, + old.rpf_addr.u.prefix4); + if (nbr) + pim_jp_agg_remove_group (nbr->upstream_jp_agg, up); /* * We have detected a case where we might need to rescan diff --git a/pimd/pim_upstream.c b/pimd/pim_upstream.c index 8ea9e3d688..0f16bc0f86 100644 --- a/pimd/pim_upstream.c +++ b/pimd/pim_upstream.c @@ -337,13 +337,6 @@ join_timer_start(struct pim_upstream *up) */ void pim_upstream_join_timer_restart(struct pim_upstream *up, struct pim_rpf *old) { - struct pim_neighbor *nbr; - - nbr = pim_neighbor_find (old->source_nexthop.interface, - old->rpf_addr.u.prefix4); - if (nbr) - pim_jp_agg_remove_group (nbr->upstream_jp_agg, up); - //THREAD_OFF(up->t_join_timer); join_timer_start(up); } diff --git a/pimd/pim_zebra.c b/pimd/pim_zebra.c index ad4ef64eda..3ff0d38185 100644 --- a/pimd/pim_zebra.c +++ b/pimd/pim_zebra.c @@ -382,6 +382,13 @@ static void scan_upstream_rpf_cache() continue; if (rpf_result == PIM_RPF_CHANGED) { + struct pim_neighbor *nbr; + + nbr = pim_neighbor_find (old.source_nexthop.interface, + old.rpf_addr.u.prefix4); + if (nbr) + pim_jp_agg_remove_group (nbr->upstream_jp_agg, up); + /* * We have detected a case where we might need to rescan * the inherited o_list so do it. -- 2.39.5