From 5bd51314352b25420ef1c8df7265b95cdad88e37 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Tue, 2 Apr 2019 21:15:21 -0400 Subject: [PATCH] pimd: Determining if we are the RP should happen always When creating new RP information from a `ip pim rp A.B.C.D/M A.B.C.D` we should determine if we are the RP even if we can or cannot determine if we have a path to the RP via RPF. This is because we should determine if we are the RP based upon a connected ip address match not whether or not we have a path to the RPF. We would normally think this is not important but RPF is inherently asynchronous and we can have a state where we have registered for nht but have not received the actual path back yet from zebra. Signed-off-by: Donald Sharp --- pimd/pim_rp.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/pimd/pim_rp.c b/pimd/pim_rp.c index 4e285720a2..e7cf208f7d 100644 --- a/pimd/pim_rp.c +++ b/pimd/pim_rp.c @@ -564,6 +564,9 @@ int pim_rp_new(struct pim_instance *pim, const char *rp, } } + pim_rp_check_interfaces(pim, rp_all); + pim_rp_refresh_group_to_rp_mapping(pim); + memset(&pnc, 0, sizeof(struct pim_nexthop_cache)); if (pim_find_or_track_nexthop(pim, &nht_p, NULL, rp_all, &pnc)) { @@ -578,8 +581,7 @@ int pim_rp_new(struct pim_instance *pim, const char *rp, &nht_p, &rp_all->group, 1)) return PIM_RP_NO_PATH; } - pim_rp_check_interfaces(pim, rp_all); - pim_rp_refresh_group_to_rp_mapping(pim); + return PIM_SUCCESS; } @@ -646,6 +648,9 @@ int pim_rp_new(struct pim_instance *pim, const char *rp, } } + pim_rp_check_interfaces(pim, rp_info); + pim_rp_refresh_group_to_rp_mapping(pim); + /* Register addr with Zebra NHT */ nht_p.family = AF_INET; nht_p.prefixlen = IPV4_MAX_BITLEN; @@ -671,8 +676,6 @@ int pim_rp_new(struct pim_instance *pim, const char *rp, return PIM_RP_NO_PATH; } - pim_rp_check_interfaces(pim, rp_info); - pim_rp_refresh_group_to_rp_mapping(pim); return PIM_SUCCESS; }