diff options
author | Jan Maria Matejka <mq@ucw.cz> | 2018-05-29 12:08:12 +0200 |
---|---|---|
committer | Jan Maria Matejka <mq@ucw.cz> | 2018-05-30 17:08:49 +0200 |
commit | 13c0be19d3d2acc9c1636bbab9222aabdf27d7ac (patch) | |
tree | 8df5514a7d995becaa85ab8a9de700cfa93cb302 /proto/babel | |
parent | ee7e2ffd265fd76dbc8c94d9c2d48da54c27ff76 (diff) |
Nest: Removing separate tmpa from route propagation
This is a fundamental change of an original (1999) concept of route
processing inside BIRD. During import/export, there was a temporary
ea_list created which was to be used instead of the another one inside
the route itself.
This led to some confusion, quirks, and strange filter code that handled
extended route attributes. Dropping it now.
The protocol interface has changed in an uniform way -- the
`struct ea_list *attrs` argument has been removed from store_tmp_attrs(),
import_control(), rt_notify() and get_route_info().
Diffstat (limited to 'proto/babel')
-rw-r--r-- | proto/babel/babel.c | 17 | ||||
-rw-r--r-- | proto/babel/config.Y | 2 |
2 files changed, 10 insertions, 9 deletions
diff --git a/proto/babel/babel.c b/proto/babel/babel.c index 83986cb9..d9e3aad2 100644 --- a/proto/babel/babel.c +++ b/proto/babel/babel.c @@ -1829,7 +1829,7 @@ babel_dump(struct proto *P) } static void -babel_get_route_info(rte *rte, byte *buf, ea_list *attrs UNUSED) +babel_get_route_info(rte *rte, byte *buf) { buf += bsprintf(buf, " (%d/%d) [%lR]", rte->pref, rte->u.babel.metric, rte->u.babel.router_id); } @@ -2087,12 +2087,13 @@ babel_prepare_attrs(struct linpool *pool, ea_list *next, uint metric, u64 router static int -babel_import_control(struct proto *P, struct rte **new, struct ea_list **attrs UNUSED, struct linpool *pool UNUSED) +babel_import_control(struct proto *P, struct rte **new, struct linpool *pool) { - rte *e = *new; + struct babel_proto *p = (void *) P; + struct rta *a = (*new)->attrs; /* Reject our own unreachable routes */ - if ((e->attrs->dest == RTD_UNREACHABLE) && (e->attrs->src->proto == P)) + if ((a->dest == RTD_UNREACHABLE) && (a->src->proto == P)) return -1; return 0; @@ -2105,9 +2106,9 @@ babel_make_tmp_attrs(struct rte *rt, struct linpool *pool) } static void -babel_store_tmp_attrs(struct rte *rt, struct ea_list *attrs) +babel_store_tmp_attrs(struct rte *rt) { - rt->u.babel.metric = ea_get_int(attrs, EA_BABEL_METRIC, 0); + rt->u.babel.metric = ea_get_int(rt->attrs->eattrs, EA_BABEL_METRIC, 0); } /* @@ -2116,7 +2117,7 @@ babel_store_tmp_attrs(struct rte *rt, struct ea_list *attrs) */ static void babel_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net, - struct rte *new, struct rte *old UNUSED, struct ea_list *attrs UNUSED) + struct rte *new, struct rte *old UNUSED) { struct babel_proto *p = (void *) P; struct babel_entry *e; @@ -2126,7 +2127,7 @@ babel_rt_notify(struct proto *P, struct channel *c UNUSED, struct network *net, /* Update */ uint internal = (new->attrs->src->proto == P); uint rt_seqno = internal ? new->u.babel.seqno : p->update_seqno; - uint rt_metric = ea_get_int(attrs, EA_BABEL_METRIC, 0); + uint rt_metric = ea_get_int(new->attrs->eattrs, EA_BABEL_METRIC, 0); u64 rt_router_id = internal ? new->u.babel.router_id : p->router_id; if (rt_metric > BABEL_INFINITY) diff --git a/proto/babel/config.Y b/proto/babel/config.Y index 205b4e4f..2b20c43f 100644 --- a/proto/babel/config.Y +++ b/proto/babel/config.Y @@ -125,7 +125,7 @@ babel_iface_opt_list: babel_iface: babel_iface_start iface_patt_list_nopx babel_iface_opt_list babel_iface_finish; -CF_ADDTO(dynamic_attr, BABEL_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_BABEL_METRIC); }) +CF_ADDTO(dynamic_attr, BABEL_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_BABEL_METRIC); }) CF_CLI_HELP(SHOW BABEL, ..., [[Show information about Babel protocol]]); |