summaryrefslogtreecommitdiffstats
path: root/sysdep/unix/krt-set.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-04-03 15:05:18 +0200
committerMartin Mares <mj@ucw.cz>1999-04-03 15:05:18 +0200
commitc10421d3d4b5f23dc953c887332bdb6e80ae0540 (patch)
tree17ea979a4796bfccbf9e58bb50fc6f501e0390be /sysdep/unix/krt-set.c
parent69ec9087ad3fb631f46275220909a876deadb6b5 (diff)
downloadbird-c10421d3d4b5f23dc953c887332bdb6e80ae0540.tar
bird-c10421d3d4b5f23dc953c887332bdb6e80ae0540.zip
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.
Diffstat (limited to 'sysdep/unix/krt-set.c')
-rw-r--r--sysdep/unix/krt-set.c38
1 files changed, 8 insertions, 30 deletions
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