Browse Source

zebra: MBGP routes should not be installed in the kernel

MBGP routes are used only for PIM RPF checks and hence should
not be installed in the kernel's FIB. Ignore route node set to Multicast
SAFI.

Signed-off-by: Balaji.G <balajig81@gmail.com>
Acked-by: Everton Marques <everton.marques@gmail.com>
[pushed down rn->table->info assignment below assert]
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Balaji 6 years ago
parent
commit
9511633e08
1 changed files with 8 additions and 2 deletions
  1. 8 2
      zebra/zebra_rib.c

+ 8 - 2
zebra/zebra_rib.c

@@ -1249,9 +1249,12 @@ rib_process (struct route_node *rn)
   struct nexthop *nexthop = NULL, *tnexthop;
   int recursing;
   char buf[INET6_ADDRSTRLEN];
-  
+  rib_table_info_t *info;
+
   assert (rn);
-  
+
+  info = rn->table->info;
+
   if (IS_ZEBRA_DEBUG_RIB || IS_ZEBRA_DEBUG_RIB_Q)
     inet_ntop (rn->p.family, &rn->p.u.prefix, buf, INET6_ADDRSTRLEN);
 
@@ -1286,6 +1289,9 @@ rib_process (struct route_node *rn)
       if (! nexthop_active_update (rn, rib, 0))
         continue;
 
+      if (info->safi == SAFI_MULTICAST)
+	continue;
+
       /* Infinit distance. */
       if (rib->distance == DISTANCE_INFINITY)
         continue;