summaryrefslogtreecommitdiff
path: root/sysdep/unix/krt.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2019-12-17 16:30:29 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2019-12-17 16:30:29 +0100
commit90a9c97e38e3769b400b434723516213eccb3ab0 (patch)
treec5cfdf9b5d18c47a5853a9cfdd163c71943b0b0f /sysdep/unix/krt.c
parent3dabf7b8d09c3188ea41b7e2f763397946943778 (diff)
KRT: Fix removal of KRF_INSTALLED
Use route id from net->routes to check export_map. Route received from sysdep KRT code does not have proper id.
Diffstat (limited to 'sysdep/unix/krt.c')
-rw-r--r--sysdep/unix/krt.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c
index f1f7c3db..470368e2 100644
--- a/sysdep/unix/krt.c
+++ b/sysdep/unix/krt.c
@@ -540,9 +540,9 @@ krt_dump_attrs(rte *e)
*/
static inline int
-krt_is_installed(struct krt_proto *p, rte *e)
+krt_is_installed(struct krt_proto *p, net *n)
{
- return bmap_test(&p->p.main_channel->export_map, e->id);
+ return n->routes && bmap_test(&p->p.main_channel->export_map, n->routes->id);
}
static void
@@ -553,11 +553,10 @@ krt_flush_routes(struct krt_proto *p)
KRT_TRACE(p, D_EVENTS, "Flushing kernel routes");
FIB_WALK(&t->fib, net, n)
{
- rte *e = n->routes;
- if (rte_is_valid(e) && krt_is_installed(p, e))
+ if (krt_is_installed(p, n))
{
/* FIXME: this does not work if gw is changed in export filter */
- krt_replace_rte(p, e->net, NULL, e);
+ krt_replace_rte(p, n, NULL, n->routes);
}
}
FIB_WALK_END;
@@ -668,7 +667,7 @@ krt_got_route(struct krt_proto *p, rte *e)
goto sentenced;
}
- if (krt_is_installed(p, e))
+ if (krt_is_installed(p, net))
{
rte *new, *rt_free;