summaryrefslogtreecommitdiffstats
path: root/zebra/zebra_rib.c
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-13 12:18:26 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-13 12:18:26 -0700
commitf71f8e6710969a3b38d2e0da4a9ac61b1615fc2f (patch)
treeabcba35b2760c86417b0720e02daf303fe4f03cd /zebra/zebra_rib.c
parent9323981b768134298e8a68c36a5889a995e51c53 (diff)
downloadquagga-f71f8e6710969a3b38d2e0da4a9ac61b1615fc2f.tar.bz2
quagga-f71f8e6710969a3b38d2e0da4a9ac61b1615fc2f.tar.xz
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.
Diffstat (limited to 'zebra/zebra_rib.c')
-rw-r--r--zebra/zebra_rib.c24
1 files changed, 7 insertions, 17 deletions
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);