[quagga-dev 8919] [PATCH] Enables zebra to be in sync with kernel routing tables.

igorm at etf.rs igorm at etf.rs
Mon Oct 24 16:29:05 BST 2011


From: Igor Maravic <igorm at etf.rs>

I did some testing of my own and came up to another solution for problem with kernel routes.
It's quite simple really. It resembles to Stephen Hemminger patch for linux kernel(http://kerneltrap.org/mailarchive/linux-netdev/2008/6/2/2010564)
because if link detection is enabled, when carrier is lost, all routes from the kernel,linked to that interface, are deleted both in kernel and zebra.

1. when link detection is disabled and carrier was lost, only ipv4 routes that are linked to that interface will be deleted. They are deleted in kernel,
and after that Quagga receives RTM_DELROUTE message, and deletes them normally. All ipv6 routes, linked to that interface, are intact.
2. when link detection is enabled and carrier was lost, interface is declared as down. Then all routes that are linked to that interface are deleted
from zebra's fib. To be sure that zebra's fib is in sync with kernel routing table, if route is from kernel(RIB_KERNEL_ROUTE (fib))
and it wasn't previously marked for deletion(del == NULL), we call function rib_uninstall_kernel and after that we mark it to be deleted from rib (del=fib).
If route was previously deleted from kernel, rib_uninstall_kernel won't have any effect. But if the route still exists in kernel, it will be deleted.
3. when interface is manually set to down, all routes linked to that interface are deleted in kernel, and they are deleted from zebra's rib.

works perfectly with Joakim Tjernlund's patch (http://lists.quagga.net/pipermail/quagga-dev/2009-January/007704.html). Unfortunatly that patch isn't applied in to main stream Quagga.

BR
Igor Maravić

Igor Maravic (1):
  Enables zebra to be in sync with kernel routing tables.

 zebra/zebra_rib.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

-- 
1.7.4.1




More information about the Quagga-dev mailing list