summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/bgpd.c
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2018-09-20 07:46:40 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2018-09-20 07:46:40 +0000
commit2d889519bcd7f6515561294c37adca6c075b8ba4 (patch)
tree187febb3e885c8830136213a40e819c35eded85b /usr.sbin/bgpd/bgpd.c
parent2eb060930a171170f9bea4e6b4eed822e09550dc (diff)
Switch prefixset to an RB_TREE instead of a SIMPLEQ. This allows to trigger
on duplicates (which are only reported) but is needed as a preparation step for roa-sets. OK benno@ denis@
Diffstat (limited to 'usr.sbin/bgpd/bgpd.c')
-rw-r--r--usr.sbin/bgpd/bgpd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/bgpd.c b/usr.sbin/bgpd/bgpd.c
index c06100781c9..239eccebdac 100644
--- a/usr.sbin/bgpd/bgpd.c
+++ b/usr.sbin/bgpd/bgpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bgpd.c,v 1.198 2018/09/09 11:00:51 benno Exp $ */
+/* $OpenBSD: bgpd.c,v 1.199 2018/09/20 07:46:39 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -437,7 +437,7 @@ reconfigure(char *conffile, struct bgpd_config *conf, struct peer **peer_l)
struct rde_rib *rr;
struct rdomain *rd;
struct prefixset *ps;
- struct prefixset_item *psi;
+ struct prefixset_item *psi, *npsi;
if (reconfpending) {
log_info("previous reload still running");
@@ -510,8 +510,8 @@ reconfigure(char *conffile, struct bgpd_config *conf, struct peer **peer_l)
if (imsg_compose(ibuf_rde, IMSG_RECONF_PREFIXSET, 0, 0, -1,
ps->name, sizeof(ps->name)) == -1)
return (-1);
- while ((psi = SIMPLEQ_FIRST(&ps->psitems)) != NULL) {
- SIMPLEQ_REMOVE_HEAD(&ps->psitems, entry);
+ RB_FOREACH_SAFE(psi, prefixset_tree, &ps->psitems, npsi) {
+ RB_REMOVE(prefixset_tree, &ps->psitems, psi);
if (imsg_compose(ibuf_rde, IMSG_RECONF_PREFIXSETITEM, 0,
0, -1, psi, sizeof(*psi)) == -1)
return (-1);