summaryrefslogtreecommitdiff
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 626583a848..2994911165 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -98,6 +98,10 @@ static const struct {
[ZEBRA_ROUTE_BGP_DIRECT_EXT] = {ZEBRA_ROUTE_BGP_DIRECT_EXT, 20, 3},
[ZEBRA_ROUTE_BABEL] = {ZEBRA_ROUTE_BABEL, 100, 2},
[ZEBRA_ROUTE_SHARP] = {ZEBRA_ROUTE_SHARP, 150, 4},
+ [ZEBRA_ROUTE_PBR] = {ZEBRA_ROUTE_PBR, 200, 4},
+ [ZEBRA_ROUTE_BFD] = {ZEBRA_ROUTE_BFD, 255, 4},
+ [ZEBRA_ROUTE_OPENFABRIC] = {ZEBRA_ROUTE_OPENFABRIC, 115, 2},
+ /* Any new route type added to zebra, should be mirrored here */
/* no entry/default: 150 */
};
@@ -3386,9 +3390,32 @@ static int rib_dplane_results(struct dplane_ctx_q *ctxlist)
return 0;
}
+/*
+ * Ensure there are no empty slots in the route_info array.
+ * Every route type in zebra should be present there.
+ */
+static void check_route_info(void)
+{
+ int len = array_size(route_info);
+
+ /*
+ * ZEBRA_ROUTE_SYSTEM is special cased since
+ * its key is 0 anyway.
+ *
+ * ZEBRA_ROUTE_ALL is also ignored.
+ */
+ for (int i = 0; i < len; i++) {
+ if (i == ZEBRA_ROUTE_SYSTEM || i == ZEBRA_ROUTE_ALL)
+ continue;
+ assert(route_info[i].key);
+ }
+}
+
/* Routing information base initialize. */
void rib_init(void)
{
+ check_route_info();
+
rib_queue_init();
/* Init dataplane, and register for results */