From f71f8e6710969a3b38d2e0da4a9ac61b1615fc2f Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 13 Apr 2009 12:18:26 -0700 Subject: Keep quagga away from kernel routes Any route created via 'ip route' etc, is a kernel route, and Quagga needs to not be trying to add/remove it from FIB on link events. It is probably something like openvpn, dhcp, etc, which can take care of it's own route events. --- zebra/zebra_rib.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'zebra/zebra_rib.c') diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index fdf125f0..f8450b70 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -892,8 +892,10 @@ rib_match_ipv6 (struct in6_addr *addr) #define RIB_SYSTEM_ROUTE(R) \ ((R)->type == ZEBRA_ROUTE_KERNEL || (R)->type == ZEBRA_ROUTE_CONNECT) + #define RIB_SHOULD_UPDATE(R) \ - (! CHECK_FLAG((R)->status, RIB_ENTRY_PRESERVE) ) + ( ! (RIB_SYSTEM_ROUTE(R) || \ + ((rib_system_routes && (R)->type == ZEBRA_ROUTE_CONNECT)))) /* This function verifies reachability of one given nexthop, which can be * numbered or unnumbered, IPv4 or IPv6. The result is unconditionally stored @@ -1728,15 +1730,9 @@ rib_add_ipv4 (int type, int flags, struct prefix_ipv4 *p, nexthop_ifindex_add (rib, ifindex, src); /* If this route is kernel route, set FIB flag to the route. */ - if (RIB_SYSTEM_ROUTE (rib)) - { - /* Mark system routes with the don't touch me flag */ - if (! rib_system_routes) - SET_FLAG(rib->status, RIB_ENTRY_PRESERVE); - - for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next) + if (type == ZEBRA_ROUTE_KERNEL || type == ZEBRA_ROUTE_CONNECT) + for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next) SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB); - } /* Link new rib to node.*/ if (IS_ZEBRA_DEBUG_RIB) @@ -2529,14 +2525,8 @@ rib_add_ipv6 (int type, int flags, struct prefix_ipv6 *p, /* If this route is kernel route, set FIB flag to the route. */ if (type == ZEBRA_ROUTE_KERNEL || type == ZEBRA_ROUTE_CONNECT) - { - /* Mark system routes with the don't touch me flag */ - if (! rib_system_routes) - SET_FLAG(rib->status, RIB_ENTRY_PRESERVE); - - for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next) - SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB); - } + for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next) + SET_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB); /* Link new rib to node.*/ rib_addnode (rn, rib); -- cgit v1.2.3