]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Determining if we are the RP should happen always
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 3 Apr 2019 01:15:21 +0000 (21:15 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 5 Apr 2019 15:12:59 +0000 (11:12 -0400)
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 <sharpd@cumulusnetworks.com>
pimd/pim_rp.c

index 4e285720a205694a237d6fe4326420deed052e7c..e7cf208f7dcb3bd65a63c65f8b366962d4f01e16 100644 (file)
@@ -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;
 }