summaryrefslogtreecommitdiffstats
path: root/nest/rt-table.c
diff options
context:
space:
mode:
Diffstat (limited to 'nest/rt-table.c')
-rw-r--r--nest/rt-table.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/nest/rt-table.c b/nest/rt-table.c
index 1303843..2ebd114 100644
--- a/nest/rt-table.c
+++ b/nest/rt-table.c
@@ -78,11 +78,22 @@ net_route(rtable *tab, ip_addr a, int len, int cast)
}
static void
-rte_init(struct fib_node *N)
+rte_init_unicast(struct fib_node *N)
{
net *n = (net *) N;
N->flags = 0;
+ n->cast = RTC_UNICAST;
+ n->routes = NULL;
+}
+
+static void
+rte_init_multicast(struct fib_node *N)
+{
+ net *n = (net *) N;
+
+ N->flags = 0;
+ n->cast = RTC_MULTICAST;
n->routes = NULL;
}
@@ -867,8 +878,8 @@ void
rt_setup(pool *p, rtable *t, char *name, struct rtable_config *cf)
{
bzero(t, sizeof(*t));
- fib_init(&t->fib_unicast, p, sizeof(net), 0, rte_init);
- fib_init(&t->fib_multicast, p, sizeof(net), 0, rte_init);
+ fib_init(&t->fib_unicast, p, sizeof(net), 0, rte_init_unicast);
+ fib_init(&t->fib_multicast, p, sizeof(net), 0, rte_init_multicast);
t->name = name;
t->config = cf;
init_list(&t->hooks);