From 13c0be19d3d2acc9c1636bbab9222aabdf27d7ac Mon Sep 17 00:00:00 2001 From: Jan Maria Matejka Date: Tue, 29 May 2018 12:08:12 +0200 Subject: 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(). --- proto/rip/config.Y | 4 ++-- proto/rip/rip.c | 15 +++++++-------- 2 files changed, 9 insertions(+), 10 deletions(-) (limited to 'proto/rip') diff --git a/proto/rip/config.Y b/proto/rip/config.Y index aff63f03..c46cf00c 100644 --- a/proto/rip/config.Y +++ b/proto/rip/config.Y @@ -186,8 +186,8 @@ rip_iface: rip_iface_start iface_patt_list_nopx rip_iface_opt_list rip_iface_finish; -CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_METRIC); }) -CF_ADDTO(dynamic_attr, RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT | EAF_TEMP, T_INT, EA_RIP_TAG); }) +CF_ADDTO(dynamic_attr, RIP_METRIC { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_RIP_METRIC); }) +CF_ADDTO(dynamic_attr, RIP_TAG { $$ = f_new_dynamic_attr(EAF_TYPE_INT, T_INT, EA_RIP_TAG); }) CF_CLI_HELP(SHOW RIP, ..., [[Show information about RIP protocol]]); diff --git a/proto/rip/rip.c b/proto/rip/rip.c index adc2b471..90bf8e5c 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -298,7 +298,7 @@ rip_withdraw_rte(struct rip_proto *p, net_addr *n, struct rip_neighbor *from) */ static void rip_rt_notify(struct proto *P, struct channel *ch UNUSED, struct network *net, struct rte *new, - struct rte *old UNUSED, struct ea_list *attrs) + struct rte *old UNUSED) { struct rip_proto *p = (struct rip_proto *) P; struct rip_entry *en; @@ -307,8 +307,8 @@ rip_rt_notify(struct proto *P, struct channel *ch UNUSED, struct network *net, s if (new) { /* Update */ - u32 rt_metric = ea_get_int(attrs, EA_RIP_METRIC, 1); - u32 rt_tag = ea_get_int(attrs, EA_RIP_TAG, 0); + u32 rt_metric = ea_get_int(new->attrs->eattrs, EA_RIP_METRIC, 1); + u32 rt_tag = ea_get_int(new->attrs->eattrs, EA_RIP_TAG, 0); if (rt_metric > p->infinity) { @@ -1040,10 +1040,10 @@ rip_make_tmp_attrs(struct rte *rt, struct linpool *pool) } static void -rip_store_tmp_attrs(struct rte *rt, struct ea_list *attrs) +rip_store_tmp_attrs(struct rte *rt) { - rt->u.rip.metric = ea_get_int(attrs, EA_RIP_METRIC, 1); - rt->u.rip.tag = ea_get_int(attrs, EA_RIP_TAG, 0); + rt->u.rip.metric = ea_get_int(rt->attrs->eattrs, EA_RIP_METRIC, 1); + rt->u.rip.tag = ea_get_int(rt->attrs->eattrs, EA_RIP_TAG, 0); } static int @@ -1081,7 +1081,6 @@ rip_init(struct proto_config *CF) P->if_notify = rip_if_notify; P->rt_notify = rip_rt_notify; P->neigh_notify = rip_neigh_notify; - // P->import_control = rip_import_control; P->reload_routes = rip_reload_routes; P->make_tmp_attrs = rip_make_tmp_attrs; P->store_tmp_attrs = rip_store_tmp_attrs; @@ -1145,7 +1144,7 @@ rip_reconfigure(struct proto *P, struct proto_config *CF) } static void -rip_get_route_info(rte *rte, byte *buf, ea_list *attrs UNUSED) +rip_get_route_info(rte *rte, byte *buf) { buf += bsprintf(buf, " (%d/%d)", rte->pref, rte->u.rip.metric); -- cgit v1.2.3