[quagga-dev 8902] [PATCH] Zebra rib/fib to be in sinc with kernel routing table. Enable Zebra rib/fib to be in sinc with kernel routing table. That means when interface goes down, all routes that are directly connected to it are deleted from Zebra's rib/fib just like they are delete from kernel routing table

igorm at etf.rs igorm at etf.rs
Thu Oct 20 13:18:35 BST 2011


From: Igor Maravic <igorm at etf.rs>


Signed-off-by: Igor Maravic <igorm at etf.rs>
---
:100644 100644 12f3fa5... 8fcefa4... M	zebra/zebra_rib.c
 zebra/zebra_rib.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 12f3fa5..8fcefa4 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -758,6 +758,9 @@ rib_match_ipv6 (struct in6_addr *addr)
 #define RIB_SYSTEM_ROUTE(R) \
         ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT)
 
+#define RIB_KERNEL_ROUTE(R) \
+		((R)->type == ZEBRA_ROUTE_KERNEL)
+
 /* This function verifies reachability of one given nexthop, which can be
  * numbered or unnumbered, IPv4 or IPv6. The result is unconditionally stored
  * in nexthop->flags field. If the 4th parameter, 'set', is non-zero,
@@ -1127,7 +1130,9 @@ rib_process (struct route_node *rn)
           buf, rn->p.prefixlen, fib);
       redistribute_delete (&rn->p, fib);
       if (! RIB_SYSTEM_ROUTE (fib))
-	rib_uninstall_kernel (rn, fib);
+    	  rib_uninstall_kernel (rn, fib);
+      else if(RIB_KERNEL_ROUTE (fib))
+    	  del=fib;
       UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED);
 
       /* Set real nexthop. */
-- 
1.7.4.1




More information about the Quagga-dev mailing list