From 2e7ee1c9d3158603c3b01bbef8559092ae46ae84 Mon Sep 17 00:00:00 2001 From: "Ondrej Zajicek (work)" Date: Fri, 22 Feb 2019 02:33:01 +0100 Subject: [PATCH] Nest: Do not compare rte.flags during rte_update() Route flags are mosty internal state of rtable, they are not significant to whether a route has changed. With the old code, all routes received as a part of enhanced route refresh are always re-announced to other peers due to change in REF_STALE. --- nest/rt-table.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nest/rt-table.c b/nest/rt-table.c index e06563f6..0975b325 100644 --- a/nest/rt-table.c +++ b/nest/rt-table.c @@ -865,12 +865,13 @@ rte_free_quick(rte *e) static int rte_same(rte *x, rte *y) { + /* rte.flags are not checked, as they are mostly internal to rtable */ return x->attrs == y->attrs && - x->flags == y->flags && x->pflags == y->pflags && x->pref == y->pref && - (!x->attrs->src->proto->rte_same || x->attrs->src->proto->rte_same(x, y)); + (!x->attrs->src->proto->rte_same || x->attrs->src->proto->rte_same(x, y)) && + rte_is_filtered(x) == rte_is_filtered(y); } static inline int rte_is_ok(rte *e) { return e && !rte_is_filtered(e); } @@ -914,7 +915,9 @@ rte_recalculate(struct announce_hook *ah, net *net, rte *new, struct rte_src *sr if (new && rte_same(old, new)) { - /* No changes, ignore the new route */ + /* No changes, ignore the new route and refresh the old one */ + + old->flags &= ~(REF_STALE | REF_DISCARD | REF_MODIFY); if (!rte_is_filtered(new)) {