diff options
author | Martin Mares <mj@ucw.cz> | 1999-03-04 19:00:31 +0000 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-03-04 19:00:31 +0000 |
commit | 111213f0b66cff8f562f7d9117c9080a9882129e (patch) | |
tree | 9f4f8057d91364cea141bf325b526e102ab8364e /sysdep/unix/krt-set.c | |
parent | e16155ae4aaee5d9ba7b6940f8312b36707718e4 (diff) |
Fixed processing of !krt_capable() routes. Converted device route decisions
to the krt_capable mechanism as well.
Diffstat (limited to 'sysdep/unix/krt-set.c')
-rw-r--r-- | sysdep/unix/krt-set.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/sysdep/unix/krt-set.c b/sysdep/unix/krt-set.c index 2165255e..ca00a2cd 100644 --- a/sysdep/unix/krt-set.c +++ b/sysdep/unix/krt-set.c @@ -26,6 +26,10 @@ krt_capable(rte *e) { rta *a = e->attrs; +#ifdef CONFIG_AUTO_ROUTES + if (a->source == RTS_DEVICE) + return 0; +#endif return a->cast == RTC_UNICAST && (a->dest == RTD_ROUTER @@ -37,18 +41,6 @@ krt_capable(rte *e) !a->tos; } -static inline int -krt_capable_op(rte *e) -{ - rta *a = e->attrs; - -#ifdef CONFIG_AUTO_ROUTES - if (a->source == RTS_DEVICE) - return 0; -#endif - return krt_capable(e); -} - static void krt_ioctl(int ioc, rte *e, char *name) { @@ -84,12 +76,12 @@ krt_ioctl(int ioc, rte *e, char *name) log(L_ERR "%s(%I/%d): %m", name, net->n.prefix, net->n.pxlen); } -static void +static inline void krt_remove_route(rte *old) { net *net = old->net; - if (!krt_capable_op(old)) + if (!krt_capable(old)) { DBG("krt_remove_route(ignored %I/%d)\n", net->n.prefix, net->n.pxlen); return; @@ -98,12 +90,12 @@ krt_remove_route(rte *old) krt_ioctl(SIOCDELRT, old, "SIOCDELRT"); } -static void +static inline void krt_add_route(rte *new) { net *net = new->net; - if (!krt_capable_op(new)) + if (!krt_capable(new)) { DBG("krt_add_route(ignored %I/%d)\n", net->n.prefix, net->n.pxlen); return; @@ -115,7 +107,6 @@ krt_add_route(rte *new) void krt_set_notify(struct proto *x, net *net, rte *new, rte *old) { - /* FIXME: Fold remove/add route here */ if (old) krt_remove_route(old); if (new) |