summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde_rib.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2009-05-21 15:47:04 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2009-05-21 15:47:04 +0000
commitac020521609fa1ef947cc159f2f03b0488a9136e (patch)
tree82e7a885fbd7040ebaedb112fcb9b95c4ddcf6e0 /usr.sbin/bgpd/rde_rib.c
parentebcc5a7d5683b46ae04eb1dc5228ed1c22c839a3 (diff)
Make it possible to turn off the decision process per RIB. This is mainly
used for the Adj-Rib-In. Also initialize the Adj-Rib-In correctly and mark it a noevaluate.
Diffstat (limited to 'usr.sbin/bgpd/rde_rib.c')
-rw-r--r--usr.sbin/bgpd/rde_rib.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c
index 28edd8dcfbc..5ee64aedbfb 100644
--- a/usr.sbin/bgpd/rde_rib.c
+++ b/usr.sbin/bgpd/rde_rib.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_rib.c,v 1.101 2009/05/17 14:45:25 claudio Exp $ */
+/* $OpenBSD: rde_rib.c,v 1.102 2009/05/21 15:47:03 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -53,6 +53,14 @@ rib_init(void)
if ((ribs = calloc(1, sizeof(struct rib))) == NULL)
fatal("rib_init");
rib_new("DEFAULT");
+
+ /* XXX we need to create Adj-RIB-In by hand */
+ bzero(&ribs[0], sizeof(struct rib));
+ RB_INIT(&ribs[0].rib);
+ ribs[0].state = RIB_ACTIVE;
+ ribs[0].id = 0;
+ strlcpy(ribs[0].name, "Adj-RIB-In", sizeof("Adj-RIB-In"));
+ ribs[0].noevaluate = 1;
}
u_int16_t
@@ -801,16 +809,12 @@ prefix_updateall(struct rde_aspath *asp, enum nexthop_state state,
{
struct prefix *p;
- if (rde_noevaluate())
- /* if the decision process is turned off this is a no-op */
- return;
-
LIST_FOREACH(p, &asp->prefix_h, path_l) {
/*
- * XXX THIS IS MISSING AT THE MOMENT
- * skip non local-RIB nodes, only local-RIB prefixes are
- * eligible.
+ * skip non local-RIBs or RIBs that are flagged as noeval.
*/
+ if (p->rib->rib->noevaluate)
+ continue;
if (oldstate == state && state == NEXTHOP_REACH) {
/*