]> git.proxmox.com Git - mirror_frr.git/commitdiff
pimd: Remove mroute when RPF is gone
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 10 Aug 2017 20:13:45 +0000 (16:13 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Fri, 11 Aug 2017 11:36:47 +0000 (07:36 -0400)
This does three things:

1) When we get a RPF_FAILURE, remove the mroute associated
with it.
   -> This way when the RPF comes back we can just add the
      mroute in as part of the normal scanning process.
2) When we do a ecmp_nexthop_search return 1 when we found
something we can use.
3) Ignore output from pim_update_rp_nh
   -> When we do a ecmp_nexthop_search ignore the return
      code and do not attempt to gather it up to return
      to the calling function.  It is just ignored
      and we were not taking into account the what of
      multiple RP's we were looking at.

Ticket: CM-17218
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
pimd/pim_nht.c

index f7fa9993adb69b8bc52bf32dc68b9d8816d9e59d..1e88ff13ff86b7299fc7b19bcd98fc4cc63fbee5 100644 (file)
@@ -248,12 +248,11 @@ void pim_delete_tracked_nexthop(struct pim_instance *pim, struct prefix *addr,
 }
 
 /* Update RP nexthop info based on Nexthop update received from Zebra.*/
-static int pim_update_rp_nh(struct pim_instance *pim,
-                           struct pim_nexthop_cache *pnc)
+static void pim_update_rp_nh(struct pim_instance *pim,
+                            struct pim_nexthop_cache *pnc)
 {
        struct listnode *node = NULL;
        struct rp_info *rp_info = NULL;
-       int ret = 0;
 
        /*Traverse RP list and update each RP Nexthop info */
        for (ALL_LIST_ELEMENTS_RO(pnc->rp_list, node, rp_info)) {
@@ -261,12 +260,11 @@ static int pim_update_rp_nh(struct pim_instance *pim,
                        continue;
 
                // Compute PIM RPF using cached nexthop
-               ret = pim_ecmp_nexthop_search(
-                       pim, pnc, &rp_info->rp.source_nexthop,
-                       &rp_info->rp.rpf_addr, &rp_info->group, 1);
+               pim_ecmp_nexthop_search(pim, pnc,
+                                       &rp_info->rp.source_nexthop,
+                                       &rp_info->rp.rpf_addr,
+                                       &rp_info->group, 1);
        }
-
-       return !ret;
 }
 
 /* This API is used to traverse nexthop cache of RPF addr
@@ -320,8 +318,10 @@ static int pim_update_upstream_nh_helper(struct hash_backet *backet, void *arg)
 
        old.source_nexthop.interface = up->rpf.source_nexthop.interface;
        rpf_result = pim_rpf_update(pim, up, &old, 0);
-       if (rpf_result == PIM_RPF_FAILURE)
+       if (rpf_result == PIM_RPF_FAILURE) {
+               pim_mroute_del(up->channel_oil, __PRETTY_FUNCTION__);
                return HASHWALK_CONTINUE;
+       }
 
        /* update kernel multicast forwarding cache (MFC) */
        if (up->channel_oil) {
@@ -525,7 +525,7 @@ int pim_ecmp_nexthop_search(struct pim_instance *pim,
                                                        pim->vrf->name,
                                                        nexthop->interface->name);
                                        }
-                                       return 0;
+                                       return 1;
                                }
                        }
                }