]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #4322 from sworleys/Nexthop-Cmp
authorRenato Westphal <renato@opensourcerouting.org>
Tue, 28 May 2019 14:32:44 +0000 (11:32 -0300)
committerGitHub <noreply@github.com>
Tue, 28 May 2019 14:32:44 +0000 (11:32 -0300)
lib: Add nexthop_cmp

1  2 
zebra/zebra_rib.c

diff --combined zebra/zebra_rib.c
index 391917ec681f66d2d8f9f9327f856a8a31a77b6c,b44ed3543f9c5d0a715e414ca583952d044af9b2..b31b6a12508b491073e7a61694bdd4042a6670f4
@@@ -2855,7 -2855,11 +2855,11 @@@ void rib_delete(afi_t afi, safi_t safi
                                break;
                        }
                        for (ALL_NEXTHOPS(re->ng, rtnh))
-                               if (nexthop_same_no_recurse(rtnh, nh)) {
+                               /*
+                                * No guarantee all kernel send nh with labels
+                                * on delete.
+                                */
+                               if (nexthop_same_no_labels(rtnh, nh)) {
                                        same = re;
                                        break;
                                }
@@@ -3127,7 -3131,6 +3131,7 @@@ void rib_sweep_table(struct route_tabl
  
        for (rn = route_top(table); rn; rn = srcdest_route_next(rn)) {
                RNODE_FOREACH_RE_SAFE (rn, re, next) {
 +
                        if (IS_ZEBRA_DEBUG_RIB)
                                route_entry_dump(&rn->p, NULL, re);
  
                        if (!CHECK_FLAG(re->flags, ZEBRA_FLAG_SELFROUTE))
                                continue;
  
 +                      /*
 +                       * If routes are older than startup_time then
 +                       * we know we read them in from the kernel.
 +                       * As such we can safely remove them.
 +                       */
 +                      if (zrouter.startup_time < re->uptime)
 +                              continue;
 +
                        /*
                         * So we are starting up and have received
                         * routes from the kernel that we have installed
  }
  
  /* Sweep all RIB tables.  */
 -void rib_sweep_route(void)
 +int rib_sweep_route(struct thread *t)
  {
        struct vrf *vrf;
        struct zebra_vrf *zvrf;
        }
  
        zebra_router_sweep_route();
 +
 +      return 0;
  }
  
  /* Remove specific by protocol routes from 'table'. */