summaryrefslogtreecommitdiff
path: root/nest/rt-table.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-02-06 16:08:45 +0100
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-02-06 16:08:45 +0100
commit28b3b551222ab58456a067a9be4790824cdbb60e (patch)
treec0ed7fa2a8aa7a221ee91b610a3d08a6f51663cc /nest/rt-table.c
parent85ad5855a02e8b185a61bbcb601f005d2e6747db (diff)
KRT: Fix IPv6 route learn
Internal table used for route learn was created with non-matching net type for IPv6 kernel proto. Thanks to Toke Hoiland-Jorgensen for the bugreport
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 6ee261e8..784f6cfb 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -1599,22 +1599,19 @@ rt_event(void *ptr)
}
void
-rt_setup(pool *p, rtable *t, char *name, struct rtable_config *cf)
+rt_setup(pool *p, rtable *t, struct rtable_config *cf)
{
bzero(t, sizeof(*t));
- t->name = name;
+ t->name = cf->name;
t->config = cf;
- t->addr_type = cf ? cf->addr_type : NET_IP4;
+ t->addr_type = cf->addr_type;
fib_init(&t->fib, p, t->addr_type, sizeof(net), OFFSETOF(net, n), 0, NULL);
init_list(&t->channels);
- if (cf)
- {
- t->rt_event = ev_new(p);
- t->rt_event->hook = rt_event;
- t->rt_event->data = t;
- t->gc_time = current_time();
- }
+ t->rt_event = ev_new(p);
+ t->rt_event->hook = rt_event;
+ t->rt_event->data = t;
+ t->gc_time = current_time();
}
/**
@@ -2090,7 +2087,7 @@ rt_commit(struct config *new, struct config *old)
{
rtable *t = mb_alloc(rt_table_pool, sizeof(struct rtable));
DBG("\t%s: created\n", r->name);
- rt_setup(rt_table_pool, t, r->name, r);
+ rt_setup(rt_table_pool, t, r);
add_tail(&routing_tables, &t->n);
r->table = t;
}