diff options
-rw-r--r-- | usr.sbin/bgpd/rde.c | 14 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.h | 11 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 4 |
3 files changed, 11 insertions, 18 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 663d234cb39..68b38d7d075 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.287 2010/02/09 13:29:15 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.288 2010/03/03 13:52:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -568,7 +568,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++) - ribs[rid].state = RIB_DELETE; + ribs[rid].state = RECONF_DELETE; break; case IMSG_NETWORK_ADD: memcpy(&netconf_p, imsg.data, sizeof(netconf_p)); @@ -598,7 +598,7 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) if (rid == RIB_FAILED) rib_new(-1, rn.name, rn.flags); else - ribs[rid].state = RIB_ACTIVE; + ribs[rid].state = RECONF_KEEP; break; case IMSG_RECONF_FILTER: if (imsg.hdr.len - IMSG_HEADER_SIZE != @@ -659,9 +659,9 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) } /* bring ribs in sync before softreconfig dance */ for (rid = 0; rid < rib_size; rid++) { - if (ribs[rid].state == RIB_DELETE) + if (ribs[rid].state == RECONF_DELETE) rib_free(&ribs[rid]); - else if (ribs[rid].state == RIB_NEW) + else if (ribs[rid].state == RECONF_REINIT) rib_dump(&ribs[0], rde_softreconfig_load, &ribs[rid], AID_UNSPEC); @@ -674,7 +674,7 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) if (reconf_out) { int i; for (i = 1; i < rib_size; i++) { - if (ribs[i].state == RIB_NEW) + if (ribs[i].state == RECONF_REINIT) /* already synced by _load */ continue; rib_dump(&ribs[i], rde_softreconfig_out, @@ -2429,7 +2429,7 @@ rde_softreconfig_in(struct rib_entry *re, void *ptr) for (i = 1; i < rib_size; i++) { /* only active ribs need a softreconfig rerun */ - if (ribs[i].state != RIB_ACTIVE) + if (ribs[i].state != RECONF_KEEP) continue; /* check if prefix changed */ diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index 6742ebdc64a..a22050fc26c 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.129 2010/01/13 06:02:37 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.130 2010/03/03 13:52:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -273,17 +273,10 @@ struct rib_entry { u_int16_t flags; }; -enum rib_state { - RIB_NONE, - RIB_NEW, - RIB_ACTIVE, - RIB_DELETE -}; - struct rib { char name[PEER_DESCR_LEN]; struct rib_tree rib; - enum rib_state state; + enum reconf_action state; u_int16_t flags; u_int16_t id; }; diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index c8a605d7d7d..7120cc1c364 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.120 2010/01/13 06:02:37 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.121 2010/03/03 13:52:39 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -78,7 +78,7 @@ rib_new(int id, char *name, u_int16_t flags) bzero(&ribs[id], sizeof(struct rib)); strlcpy(ribs[id].name, name, sizeof(ribs[id].name)); RB_INIT(&ribs[id].rib); - ribs[id].state = RIB_NEW; + ribs[id].state = RECONF_REINIT; ribs[id].id = id; ribs[id].flags = flags; |