From 2ef9177a47e7137dd09b06a353a6e5f6e671c951 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sun, 14 Nov 2010 05:49:56 +0100 Subject: Add multicast support to static protocol and generic route handling. --- sysdep/unix/krt.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sysdep/unix') diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index 562dc71..6785161 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -324,7 +324,7 @@ krt_learn_scan(struct krt_proto *p, rte *e) static void krt_learn_prune(struct krt_proto *p) { - struct fib *fib = &p->krt_table.fib; + struct fib *fib = rt_fib(&p->krt_table, RTC_UNICAST); struct fib_iterator fit; KRT_TRACE(p, D_EVENTS, "Pruning inherited routes"); @@ -502,7 +502,7 @@ krt_flush_routes(struct krt_proto *p) struct rtable *t = p->p.table; KRT_TRACE(p, D_EVENTS, "Flushing kernel routes"); - FIB_WALK(&t->fib, f) + FIB_WALK(rt_fib(t, RTC_UNICAST), f) { net *n = (net *) f; rte *e = n->routes; @@ -616,7 +616,7 @@ krt_prune(struct krt_proto *p) struct rtable *t = p->p.table; KRT_TRACE(p, D_EVENTS, "Pruning table %s", t->name); - FIB_WALK(&t->fib, f) + FIB_WALK(rt_fib(t, RTC_UNICAST), f) { net *n = (net *) f; int verdict = f->flags & KRF_VERDICT_MASK; @@ -743,6 +743,9 @@ krt_import_control(struct proto *P, rte **new, ea_list **attrs, struct linpool * if (e->attrs->proto == P) return -1; + if (e->attrs->cast != RTC_UNICAST) + return -1; + if (!KRT_CF->devroutes && (e->attrs->dest == RTD_DEVICE) && (e->attrs->source != RTS_STATIC_DEVICE)) -- cgit v1.2.3