summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-07-12 15:05:04 +0200
committerMaria Matejka <mq@ucw.cz>2022-07-12 15:05:04 +0200
commit4f16270dd91df68410760edad3fa7a1ecfc1c35b (patch)
treef786eb7100971a6f8b231ff0c4189d2b5afa0dca /nest/rt-table.c
parent2a27564423638e2bbe2a3d879bf2967d2d3b9426 (diff)
parentf18968f52f461946b64aaea6c4a0e88c5235fb07 (diff)
Merge commit 'f18968f5' into thread-next
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 50ddc141..3f8c7a83 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -3573,9 +3573,12 @@ rt_update_hostentry(rtable *tab, struct hostentry *he)
{
struct rte_storage *e = n->routes;
ea_list *a = e->rte.attrs;
- pxlen = n->n.addr->pxlen;
+ u32 pref = rt_get_preference(&e->rte);
- if (ea_find(a, &ea_gen_hostentry))
+ for (struct rte_storage *ee = n->routes; ee; ee = ee->next)
+ if (rte_is_valid(&ee->rte) &&
+ (rt_get_preference(&ee->rte) >= pref) &&
+ ea_find(ee->rte.attrs, &ea_gen_hostentry))
{
/* Recursive route should not depend on another recursive route */
log(L_WARN "Next hop address %I resolvable through recursive route for %N",
@@ -3583,6 +3586,8 @@ rt_update_hostentry(rtable *tab, struct hostentry *he)
goto done;
}
+ pxlen = n->n.addr->pxlen;
+
eattr *nhea = ea_find(a, &ea_gen_nexthop);
ASSERT_DIE(nhea);
struct nexthop_adata *nhad = (void *) nhea->u.ptr;