fib: Decouple source from priority and behaviour
[vpp.git] / src / vnet / fib / fib_entry_src_adj.c
index b7f5946..ec80a86 100644 (file)
@@ -373,19 +373,23 @@ fib_entry_src_adj_cover_update (fib_entry_src_t *src,
      * prefix is updated during the covers walk.
      */
     fib_entry_src_cover_res_t res = {
-        .install = !0,
+        .install = 0,
         .bw_reason = FIB_NODE_BW_REASON_FLAG_NONE,
     };
     fib_entry_t *cover;
 
-    ASSERT(FIB_NODE_INDEX_INVALID != src->u.adj.fesa_cover);
-
-    cover = fib_entry_get(src->u.adj.fesa_cover);
-
-    res.install = (FIB_ENTRY_FLAG_ATTACHED & fib_entry_get_flags_i(cover));
+    /*
+     * If there is no cover, then the source is not active and we can ignore
+     * this update
+     */
+    if (FIB_NODE_INDEX_INVALID != src->u.adj.fesa_cover)
+    {
+        cover = fib_entry_get(src->u.adj.fesa_cover);
 
-    FIB_ENTRY_DBG(fib_entry, "adj-src-cover-updated");
+        res.install = (FIB_ENTRY_FLAG_ATTACHED & fib_entry_get_flags_i(cover));
 
+        FIB_ENTRY_DBG(fib_entry, "adj-src-cover-updated");
+    }
     return (res);
 }
 
@@ -407,5 +411,5 @@ const static fib_entry_src_vft_t adj_src_vft = {
 void
 fib_entry_src_adj_register (void)
 {
-    fib_entry_src_register(FIB_SOURCE_ADJ, &adj_src_vft);
+    fib_entry_src_behaviour_register(FIB_SOURCE_BH_ADJ, &adj_src_vft);
 }