From 875cc073b067f295cccc668008e10218f8e98dd3 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Thu, 14 Mar 2019 17:22:22 +0100 Subject: Nest: Update handling of temporary attributes The temporary atttributes are no longer removed by ea_do_prune(), but they are undefined by store_tmp_attrs() protocol hooks. This fixes several bugs where temporary attributes were removed when they should not or not removed when they should be. The flag EAF_TEMP is no longer needed and was removed. Update all protocol make_tmp_attrs() / store_tmp_attrs() hooks to use helper functions and to handle unset attributes properly. Also fix some related bugs like improper handling of empty eattr list. --- nest/rt-show.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'nest/rt-show.c') diff --git a/nest/rt-show.c b/nest/rt-show.c index c7bcdf2f..002a6039 100644 --- a/nest/rt-show.c +++ b/nest/rt-show.c @@ -45,10 +45,11 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d) else from[0] = 0; - get_route_info = a->src->proto->proto->get_route_info; /* Need to normalize the extended attributes */ - if ((get_route_info || d->verbose) && !rta_is_cached(a)) + if (d->verbose && !rta_is_cached(a) && a->eattrs) ea_normalize(a->eattrs); + + get_route_info = a->src->proto->proto->get_route_info; if (get_route_info) get_route_info(e, info); else @@ -114,7 +115,7 @@ rt_show_net(struct cli *c, net *n, struct rt_show_data *d) continue; ee = e; - rte_make_tmp_attrs(&e, c->show_pool); + rte_make_tmp_attrs(&e, c->show_pool, NULL); /* Export channel is down, do not try to export routes to it */ if (ec && (ec->export_state == ES_DOWN)) -- cgit v1.2.3