summaryrefslogtreecommitdiff
path: root/usr.sbin/bgpd/rde.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/bgpd/rde.c')
-rw-r--r--usr.sbin/bgpd/rde.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c
index 0257653069f..79cf5a42545 100644
--- a/usr.sbin/bgpd/rde.c
+++ b/usr.sbin/bgpd/rde.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde.c,v 1.411 2018/08/06 15:59:01 claudio Exp $ */
+/* $OpenBSD: rde.c,v 1.412 2018/08/08 06:54:50 benno Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -773,7 +773,7 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf)
fatal(NULL);
memcpy(nconf, imsg.data, sizeof(struct bgpd_config));
for (rid = 0; rid < rib_size; rid++) {
- if (*ribs[rid].name == '\0')
+ if (!rib_valid(rid))
break;
ribs[rid].state = RECONF_DELETE;
}
@@ -1320,7 +1320,7 @@ rde_update_update(struct rde_peer *peer, struct filterstate *in,
fatalx("rde_update_update: no prefix in Adj-RIB-In");
for (i = RIB_LOC_START; i < rib_size; i++) {
- if (*ribs[i].name == '\0')
+ if (!rib_valid(i))
break;
rde_filterstate_prep(&state, &in->aspath, in->nexthop,
in->nhflags);
@@ -1352,7 +1352,7 @@ rde_update_withdraw(struct rde_peer *peer, struct bgpd_addr *prefix,
u_int16_t i;
for (i = RIB_LOC_START; i < rib_size; i++) {
- if (*ribs[i].name == '\0')
+ if (!rib_valid(i))
break;
if (prefix_remove(&ribs[i].rib, peer, prefix, prefixlen, 0))
rde_update_log("withdraw", i, peer, NULL, prefix,
@@ -2799,7 +2799,7 @@ rde_reload_done(void)
}
/* bring ribs in sync */
for (rid = 0; rid < rib_size; rid++) {
- if (*ribs[rid].name == '\0')
+ if (!rib_valid(rid))
continue;
rde_filter_calc_skip_steps(ribs[rid].in_rules_tmp);
@@ -2868,7 +2868,7 @@ rde_softreconfig_done(void *arg)
filterlist_free(out_rules_tmp);
out_rules_tmp = NULL;
for (rid = 0; rid < rib_size; rid++) {
- if (*ribs[rid].name == '\0')
+ if (!rib_valid(rid))
continue;
ribs[rid].state = RECONF_NONE;
}
@@ -2904,7 +2904,7 @@ rde_softreconfig_in(struct rib_entry *re, void *bula)
rib = &ribs[i];
if (rib->state != RECONF_RELOAD)
continue;
- if (*rib->name == '\0')
+ if (!rib_valid(i))
break;
rde_filterstate_prep(&state, asp, prefix_nexthop(p),
@@ -3486,7 +3486,7 @@ network_add(struct network_config *nc, int flagstatic)
nc->prefixlen, 0))
peerself->prefix_cnt++;
for (i = RIB_LOC_START; i < rib_size; i++) {
- if (*ribs[i].name == '\0')
+ if (!rib_valid(i))
break;
rde_update_log("announce", i, peerself,
state.nexthop ? &state.nexthop->exit_nexthop : NULL,
@@ -3538,7 +3538,7 @@ network_delete(struct network_config *nc, int flagstatic)
}
for (i = RIB_LOC_START; i < rib_size; i++) {
- if (*ribs[i].name == '\0')
+ if (!rib_valid(i))
break;
if (prefix_remove(&ribs[i].rib, peerself, &nc->prefix,
nc->prefixlen, flags))
@@ -3607,7 +3607,7 @@ rde_shutdown(void)
/* free filters */
filterlist_free(out_rules);
for (i = 0; i < rib_size; i++) {
- if (*ribs[i].name == '\0')
+ if (!rib_valid(i))
break;
filterlist_free(ribs[i].in_rules);
}