From c10421d3d4b5f23dc953c887332bdb6e80ae0540 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 3 Apr 1999 13:05:18 +0000 Subject: More changes to the kernel syncer. o Now compatible with filtering. o Learning of kernel routes supported only on CONFIG_SELF_CONSCIOUS systems (on the others it's impossible to get it semantically correct). o Learning now stores all of its routes in a separate fib and selects the ones the kernel really uses for forwarding packets. o Better treatment of CONFIG_AUTO_ROUTES ports. o Lots of internal changes. --- sysdep/unix/krt-set.c | 38 ++++++++------------------------------ 1 file changed, 8 insertions(+), 30 deletions(-) (limited to 'sysdep/unix/krt-set.c') diff --git a/sysdep/unix/krt-set.c b/sysdep/unix/krt-set.c index 5be01c4..435587b 100644 --- a/sysdep/unix/krt-set.c +++ b/sysdep/unix/krt-set.c @@ -77,41 +77,19 @@ krt_ioctl(int ioc, rte *e, char *name) log(L_ERR "%s(%I/%d): %m", name, net->n.prefix, net->n.pxlen); } -static inline void -krt_remove_route(rte *old) +void +krt_set_notify(struct krt_proto *p, net *net, rte *new, rte *old) { - net *net = old->net; - - if (!krt_capable(old)) + if (old) { - DBG("krt_remove_route(ignored %I/%d)\n", net->n.prefix, net->n.pxlen); - return; + DBG("krt_remove_route(%I/%d)\n", net->n.prefix, net->n.pxlen); + krt_ioctl(SIOCDELRT, old, "SIOCDELRT"); } - DBG("krt_remove_route(%I/%d)\n", net->n.prefix, net->n.pxlen); - krt_ioctl(SIOCDELRT, old, "SIOCDELRT"); -} - -static inline void -krt_add_route(rte *new) -{ - net *net = new->net; - - if (!krt_capable(new)) + if (new) { - DBG("krt_add_route(ignored %I/%d)\n", net->n.prefix, net->n.pxlen); - return; + DBG("krt_add_route(%I/%d)\n", net->n.prefix, net->n.pxlen); + krt_ioctl(SIOCADDRT, new, "SIOCADDRT"); } - DBG("krt_add_route(%I/%d)\n", net->n.prefix, net->n.pxlen); - krt_ioctl(SIOCADDRT, new, "SIOCADDRT"); -} - -void -krt_set_notify(struct proto *x, net *net, rte *new, rte *old) -{ - if (old) - krt_remove_route(old); - if (new) - krt_add_route(new); } void -- cgit v1.2.3