From 86975e584eeabbc4f3111f2d100f05ca00579d31 Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Fri, 21 Aug 2009 09:43:31 +0200 Subject: Allow more kernel routing tables in IPv6. --- sysdep/linux/netlink/netlink.Y | 5 ----- 1 file changed, 5 deletions(-) (limited to 'sysdep/linux') diff --git a/sysdep/linux/netlink/netlink.Y b/sysdep/linux/netlink/netlink.Y index c448d89..c5dcf62 100644 --- a/sysdep/linux/netlink/netlink.Y +++ b/sysdep/linux/netlink/netlink.Y @@ -18,13 +18,8 @@ CF_ADDTO(kern_proto, kern_proto nl_item ';') nl_item: KERNEL TABLE expr { -#ifndef IPV6 if ($3 <= 0 || $3 >= NL_NUM_TABLES) cf_error("Kernel routing table number out of range"); -#else - if ($3 != 254) - cf_error("Linux implementation of IPv6 doesn't support multiple routing tables"); -#endif THIS_KRT->scan.table_id = $3; } ; -- cgit v1.2.3 From 2d507e64b7d7029906aac30dbea317795b5339de Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Thu, 24 Sep 2009 19:08:14 +0200 Subject: Do not allow gateway routes with NULL iface. --- sysdep/linux/krt-scan.c | 6 ++++-- sysdep/linux/netlink/netlink.c | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) (limited to 'sysdep/linux') diff --git a/sysdep/linux/krt-scan.c b/sysdep/linux/krt-scan.c index b7fc129..374cf01 100644 --- a/sysdep/linux/krt-scan.c +++ b/sysdep/linux/krt-scan.c @@ -103,8 +103,10 @@ krt_parse_entry(byte *ent, struct krt_proto *p) if (ng && ng->scope) a.iface = ng->iface; else - /* FIXME: Remove this warning? Handle it somehow... */ - log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", gw, net->n.prefix, net->n.pxlen); + { + log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", ra.gw, net->n.prefix, net->n.pxlen); + return; + } a.dest = RTD_ROUTER; a.gw = gw; } diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index 2e85f54..9f839af 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -686,8 +686,10 @@ nl_parse_route(struct nlmsghdr *h, int scan) if (ng && ng->scope) ra.iface = ng->iface; else - /* FIXME: Remove this warning? Handle it somehow... */ - log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", ra.gw, net->n.prefix, net->n.pxlen); + { + log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", ra.gw, net->n.prefix, net->n.pxlen); + return; + } } else { -- cgit v1.2.3 From aa7088fe2646e53b5168f7ea4e5bd098f891951c Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Wed, 30 Sep 2009 16:34:47 +0200 Subject: Fixes one previous commit. --- sysdep/linux/krt-scan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysdep/linux') diff --git a/sysdep/linux/krt-scan.c b/sysdep/linux/krt-scan.c index 374cf01..feb128e 100644 --- a/sysdep/linux/krt-scan.c +++ b/sysdep/linux/krt-scan.c @@ -104,7 +104,7 @@ krt_parse_entry(byte *ent, struct krt_proto *p) a.iface = ng->iface; else { - log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", ra.gw, net->n.prefix, net->n.pxlen); + log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", gw, net->n.prefix, net->n.pxlen); return; } a.dest = RTD_ROUTER; -- cgit v1.2.3 From bff74c7aa3ce4d407cb18b48c9df7b670c3c7a3d Mon Sep 17 00:00:00 2001 From: Ondrej Zajicek Date: Tue, 20 Oct 2009 19:04:28 +0200 Subject: Allows importing 'onlink' routes. --- sysdep/linux/netlink/netlink.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'sysdep/linux') diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index 9f839af..03d4388 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -682,13 +682,29 @@ nl_parse_route(struct nlmsghdr *h, int scan) ra.dest = RTD_ROUTER; memcpy(&ra.gw, RTA_DATA(a[RTA_GATEWAY]), sizeof(ra.gw)); ipa_ntoh(ra.gw); - ng = neigh_find(&p->p, &ra.gw, 0); - if (ng && ng->scope) - ra.iface = ng->iface; + + if (i->rtm_flags & RTNH_F_ONLINK) + { + /* route with 'onlink' attribute */ + ra.iface = if_find_by_index(oif); + if (ra.iface == NULL) + { + log(L_WARN "Kernel told us to use unknown interface %u for %I/%d", + oif, net->n.prefix, net->n.pxlen); + return; + } + } else { - log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", ra.gw, net->n.prefix, net->n.pxlen); - return; + /* standard route */ + ng = neigh_find(&p->p, &ra.gw, 0); + if (ng && ng->scope) + ra.iface = ng->iface; + else + { + log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", ra.gw, net->n.prefix, net->n.pxlen); + return; + } } } else -- cgit v1.2.3