diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-03-29 09:06:57 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2010-03-29 09:06:57 +0000 |
commit | c6cffdf593a29cabf603cd3ab3421f90005d4b50 (patch) | |
tree | 802598de27b23e42a9792305838cee69f52dc562 | |
parent | 4310b6e0e7578af8e22492f30466678413c8a490 (diff) |
We always allocate rib ids dynamicaly so there is no need for allowing
fixed id allocation. Makes code simpler.
OK henning
-rw-r--r-- | usr.sbin/bgpd/rde.c | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde.h | 4 | ||||
-rw-r--r-- | usr.sbin/bgpd/rde_rib.c | 13 |
3 files changed, 10 insertions, 11 deletions
diff --git a/usr.sbin/bgpd/rde.c b/usr.sbin/bgpd/rde.c index 68b38d7d075..9c355e17469 100644 --- a/usr.sbin/bgpd/rde.c +++ b/usr.sbin/bgpd/rde.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.c,v 1.288 2010/03/03 13:52:39 claudio Exp $ */ +/* $OpenBSD: rde.c,v 1.289 2010/03/29 09:06:56 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -596,7 +596,7 @@ rde_dispatch_imsg_parent(struct imsgbuf *ibuf) memcpy(&rn, imsg.data, sizeof(rn)); rid = rib_find(rn.name); if (rid == RIB_FAILED) - rib_new(-1, rn.name, rn.flags); + rib_new(rn.name, rn.flags); else ribs[rid].state = RECONF_KEEP; break; diff --git a/usr.sbin/bgpd/rde.h b/usr.sbin/bgpd/rde.h index f7dbb0bd025..7bcb26a2bcf 100644 --- a/usr.sbin/bgpd/rde.h +++ b/usr.sbin/bgpd/rde.h @@ -1,4 +1,4 @@ -/* $OpenBSD: rde.h,v 1.131 2010/03/05 15:25:00 claudio Exp $ */ +/* $OpenBSD: rde.h,v 1.132 2010/03/29 09:06:56 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> and @@ -361,7 +361,7 @@ void community_ext_delete(struct rde_aspath *, extern u_int16_t rib_size; extern struct rib *ribs; -u_int16_t rib_new(int, char *, u_int16_t); +u_int16_t rib_new(char *, u_int16_t); u_int16_t rib_find(char *); void rib_free(struct rib *); struct rib_entry *rib_get(struct rib *, struct bgpd_addr *, int); diff --git a/usr.sbin/bgpd/rde_rib.c b/usr.sbin/bgpd/rde_rib.c index db17366ed1e..e53ab08b56c 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.122 2010/03/26 15:38:39 claudio Exp $ */ +/* $OpenBSD: rde_rib.c,v 1.123 2010/03/29 09:06:56 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org> @@ -50,16 +50,15 @@ RB_GENERATE(rib_tree, rib_entry, rib_e, rib_compare); /* RIB specific functions */ u_int16_t -rib_new(int id, char *name, u_int16_t flags) +rib_new(char *name, u_int16_t flags) { struct rib *xribs; size_t newsize; + u_int16_t id; - if (id < 0) { - for (id = 0; id < rib_size; id++) { - if (*ribs[id].name == '\0') - break; - } + for (id = 0; id < rib_size; id++) { + if (*ribs[id].name == '\0') + break; } if (id == RIB_FAILED) |