
igorm at etf
Oct 26, 2011, 1:07 AM
Post #13 of 16
(1089 views)
Permalink
|
|
Re: [PATCH] Enables zebra to be in sync with kernel routing tables.
[In reply to]
|
|
You were right. It's network manager fault. When it deletes routes on carrier lost, there is RTM_DELROUTE netlink message, that zebra catches. But there still remains the problem when interface is manually brought down. Then all static routes, ipv4 and ipv6, are deleted. There are no RTM_DELROUTE messages. Do you think that deleteing static routes from zebra's fib, if interface is down would be proper solution? BR Igor Signed-off-by: Igor Maravic <igorm [at] etf> --- :100644 100644 12f3fa5... 22912f0... M zebra/zebra_rib.c zebra/zebra_rib.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 12f3fa5..22912f0 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, @@ -1128,6 +1131,9 @@ rib_process (struct route_node *rn) redistribute_delete (&rn->p, fib); if (! RIB_SYSTEM_ROUTE (fib)) rib_uninstall_kernel (rn, fib); + else if(RIB_KERNEL_ROUTE (fib) && !if_is_up(if_lookup_by_index(fib->nexthop->ifindex))){ + del=fib; + } UNSET_FLAG (fib->flags, ZEBRA_FLAG_SELECTED); /* Set real nexthop. */ -- 2011/10/25 Greg Troxel <gdt [at] ir>: > > Yes, on my OS when cable is unplugged for a 1 sec, all ipv4 routes > that are linked to that interface are deleted. IPv6 routes aren't > deleted. When interface is manually put down, all routes, ipv4 and > > It seems pretty obvious to me that the v4 static routes being deleted on > loss of link is a bug, and a departure from longstanding practice. It's > a huge clue that v4 and v6 behave differently. > > Isn't there a netlink message from the kernel when the routes are > deleted? If not, that's a kernel bug. > > From: "\"Oleg A. Arkhangelsky\"" <sysoleg [at] yandex> > [ubuntu network manager] > > Thanks - it sounds like you have identified the source of the trouble. > > > _______________________________________________ Quagga-dev mailing list Quagga-dev [at] lists http://lists.quagga.net/mailman/listinfo/quagga-dev
|