From 111213f0b66cff8f562f7d9117c9080a9882129e Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Thu, 4 Mar 1999 19:00:31 +0000 Subject: Fixed processing of !krt_capable() routes. Converted device route decisions to the krt_capable mechanism as well. --- sysdep/linux/netlink/netlink.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'sysdep/linux/netlink') diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index 64e3aa2..4aadc85 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -430,6 +430,8 @@ krt_capable(rte *e) if (a->cast != RTC_UNICAST) /* FIXME: For IPv6, we might support anycasts as well */ return 0; + if (a->source == RTS_DEVICE) /* Kernel takes care of device routes itself */ + return 0; switch (a->dest) { case RTD_ROUTER: @@ -501,9 +503,9 @@ nl_send_route(rte *e, int new) void krt_set_notify(struct proto *p, net *n, rte *new, rte *old) { - if (old && old->attrs->source == RTS_DEVICE) /* Device routes are left to the kernel */ + if (old && !krt_capable(old)) old = NULL; - if (new && new->attrs->source == RTS_DEVICE) + if (new && !krt_capable(new)) new = NULL; if (old && new && old->attrs->tos == new->attrs->tos) { -- cgit v1.2.3