]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: Add a base node for the zebra vrf tables
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 6 Feb 2019 19:44:44 +0000 (14:44 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 27 Mar 2019 20:19:28 +0000 (16:19 -0400)
Add a default route_node for our routing tables.  This will allow us
to know that we can hang data off the default route for processing.

We will be hanging the nexthop tracking data structures off the rib_dest_t
so that we can know which nexthops we need to handle.  Effectively
nexthops that we are tracking that are unresolved will be stored on the
default route.  When something changes in the rib tree we can
work up the rn->parent pointer checking for nexthops we need to re-evaluate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_rib.c
zebra/zebra_vrf.c

index 5d98d616456ea97b5f7637d81c33b48936b87531..6b837e4e362cc8e37c50ff6db2f10558e644ade2 100644 (file)
@@ -1204,6 +1204,16 @@ static int rib_can_delete_dest(rib_dest_t *dest)
                return 0;
        }
 
+       /*
+        * Unresolved rnh's are stored on the default route's list
+        *
+        * dest->rnode can also be the source prefix node in an
+        * ipv6 sourcedest table.  Fortunately the prefix of a
+        * source prefix node can never be the default prefix.
+        */
+       if (is_default_prefix(&dest->rnode->p))
+               return 0;
+
        /*
         * Don't delete the dest if we have to update the FPM about this
         * prefix.
index 90f94902f341c235b8a4aa8a7c8241f259e6762d..89bda4276e02424792b79e92584dd6ba153cf852 100644 (file)
@@ -370,10 +370,19 @@ static void zebra_rnhtable_node_cleanup(struct route_table *table,
 static void zebra_vrf_table_create(struct zebra_vrf *zvrf, afi_t afi,
                                   safi_t safi)
 {
+       struct route_node *rn;
+       struct prefix p;
+
        assert(!zvrf->table[afi][safi]);
 
        zvrf->table[afi][safi] =
                zebra_router_get_table(zvrf, zvrf->table_id, afi, safi);
+
+       memset(&p, 0, sizeof(p));
+       p.family = afi2family(afi);
+
+       rn = srcdest_rnode_get(zvrf->table[afi][safi], &p, NULL);
+       zebra_rib_create_dest(rn);
 }
 
 /* Allocate new zebra VRF. */