From 035d32216e5a779b4d4f0ca72e4db41f735a46d1 Mon Sep 17 00:00:00 2001 From: Claudio Jeker Date: Thu, 4 Jun 2009 04:46:43 +0000 Subject: Add "rde rib " to the config and allow the rde to use these other RIBs. Still a bit hackish, reload is missing and printconf as well. Looks good h@ --- usr.sbin/bgpd/rde_rib.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'usr.sbin/bgpd/rde_rib.c') diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index b023c3c7fca..761db5db985 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.112 2009/06/03 20:22:04 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.113 2009/06/04 04:46:42 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker @@ -49,19 +49,19 @@ RB_GENERATE(rib_tree, rib_entry, rib_e, rib_compare); /* RIB specific functions */ -void -rib_init(void) -{ - rib_new(1, "DEFAULT", 0); - rib_new(0, "Adj-RIB-In", F_RIB_NOEVALUATE); -} - u_int16_t -rib_new(u_int16_t id, char *name, u_int16_t flags) +rib_new(int id, char *name, u_int16_t flags) { struct rib *xribs; size_t newsize; + if (id < 0) { + for (id = 0; id < rib_size; id++) { + if (*ribs[id].name == '\0') + break; + } + } + if (id >= rib_size) { newsize = sizeof(struct rib) * (id + 1); if ((xribs = realloc(ribs, newsize)) == NULL) { -- cgit v1.2.3