diff options
author | 2017-01-23 13:08:47 +0000 | |
---|---|---|
committer | 2017-01-23 13:08:47 +0000 | |
commit | 2d4ddadb3717da161b4ab230a075bc6e1c738f1a (patch) | |
tree | 61772359f8538028b44cc4261fc5738bd53af85e | |
parent | Enable simplefb(4). (diff) | |
download | wireguard-openbsd-2d4ddadb3717da161b4ab230a075bc6e1c738f1a.tar.xz wireguard-openbsd-2d4ddadb3717da161b4ab230a075bc6e1c738f1a.zip |
Revert the struct rib_tree rename. I need a struct in between because of
how struct rib_entry is used.
-rw-r--r-- | usr.sbin/bgpd/rde.h | 6 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 22 |
2 files changed, 14 insertions, 14 deletions
diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index a5e18cad236..e2448a827b3 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.154 2017/01/23 12:25:19 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.155 2017/01/23 13:08:47 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -43,7 +43,7 @@ LIST_HEAD(rde_peer_head, rde_peer); LIST_HEAD(aspath_head, rde_aspath); RB_HEAD(uptree_prefix, update_prefix); RB_HEAD(uptree_attr, update_attr); -RB_HEAD(rib, rib_entry); +RB_HEAD(rib_tree, rib_entry); TAILQ_HEAD(uplist_prefix, update_prefix); TAILQ_HEAD(uplist_attr, update_attr); @@ -287,7 +287,7 @@ struct rib_entry { struct rib_desc { char name[PEER_DESCR_LEN]; - struct rib rib; + struct rib_tree rib; struct filter_head *in_rules; struct filter_head *in_rules_tmp; u_int rtableid; diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index ac67d18fe72..9492cc630d1 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.146 2017/01/23 12:25:19 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.147 2017/01/23 13:08:47 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -45,8 +45,8 @@ void rib_remove(struct rib_entry *); int rib_empty(struct rib_entry *); struct rib_entry *rib_restart(struct rib_context *); -RB_PROTOTYPE(rib, rib_entry, rib_e, rib_compare); -RB_GENERATE(rib, rib_entry, rib_e, rib_compare); +RB_PROTOTYPE(rib_tree, rib_entry, rib_e, rib_compare); +RB_GENERATE(rib_tree, rib_entry, rib_e, rib_compare); /* RIB specific functions */ @@ -124,8 +124,8 @@ rib_free(struct rib_desc *rib) } } - for (re = RB_MIN(rib, &rib->rib); re != NULL; re = xre) { - xre = RB_NEXT(rib, &rib->rib, re); + for (re = RB_MIN(rib_tree, &rib->rib); re != NULL; re = xre) { + xre = RB_NEXT(rib_tree, &rib->rib, re); /* * Removing the prefixes is tricky because the last one @@ -169,7 +169,7 @@ rib_get(struct rib_desc *rib, struct bgpd_addr *prefix, int prefixlen) bzero(&xre, sizeof(xre)); xre.prefix = pte; - return (RB_FIND(rib, &rib->rib, &xre)); + return (RB_FIND(rib_tree, &rib->rib, &xre)); } struct rib_entry * @@ -219,7 +219,7 @@ rib_add(struct rib_desc *rib, struct bgpd_addr *prefix, int prefixlen) re->flags = rib->flags; re->ribid = rib->id; - if (RB_INSERT(rib, &rib->rib, re) != NULL) { + if (RB_INSERT(rib_tree, &rib->rib, re) != NULL) { log_warnx("rib_add: insert failed"); free(re); return (NULL); @@ -246,7 +246,7 @@ rib_remove(struct rib_entry *re) if (pt_empty(re->prefix)) pt_remove(re->prefix); - if (RB_REMOVE(rib, &ribs[re->ribid].rib, re) == NULL) + if (RB_REMOVE(rib_tree, &ribs[re->ribid].rib, re) == NULL) log_warnx("rib_remove: remove failed."); free(re); @@ -281,12 +281,12 @@ rib_dump_r(struct rib_context *ctx) unsigned int i; if (ctx->ctx_re == NULL) { - re = RB_MIN(rib, &ctx->ctx_rib->rib); + re = RB_MIN(rib_tree, &ctx->ctx_rib->rib); LIST_INSERT_HEAD(&rib_dump_h, ctx, entry); } else re = rib_restart(ctx); - for (i = 0; re != NULL; re = RB_NEXT(rib, unused, re)) { + for (i = 0; re != NULL; re = RB_NEXT(rib_tree, unused, re)) { if (ctx->ctx_aid != AID_UNSPEC && ctx->ctx_aid != re->prefix->aid) continue; @@ -317,7 +317,7 @@ rib_restart(struct rib_context *ctx) /* find first non empty element */ while (re && rib_empty(re)) - re = RB_NEXT(rib, unused, re); + re = RB_NEXT(rib_tree, unused, re); /* free the previously locked rib element if empty */ if (rib_empty(ctx->ctx_re)) |