diff options
Diffstat (limited to 'sysdep/linux')
-rw-r--r-- | sysdep/linux/krt-scan.c | 6 | ||||
-rw-r--r-- | sysdep/linux/netlink/netlink.Y | 5 | ||||
-rw-r--r-- | sysdep/linux/netlink/netlink.c | 38 |
3 files changed, 31 insertions, 18 deletions
diff --git a/sysdep/linux/krt-scan.c b/sysdep/linux/krt-scan.c index b7fc129..feb128e 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", gw, net->n.prefix, net->n.pxlen); + return; + } a.dest = RTD_ROUTER; a.gw = gw; } 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; } ; diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index 6cfb0ba..f45fe15 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -691,18 +691,34 @@ 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_find2(&p->p, &ra.gw, ifa, 0); - if (ng && ng->scope) - { - if (ng->iface != ifa) - log(L_WARN "KRT: Route with unexpected iface for %I/%d", net->n.prefix, net->n.pxlen); - 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; - } + { + ng = neigh_find2(&p->p, &ra.gw, ifa, 0); + if (ng && ng->scope) + { + if (ng->iface != ifa) + log(L_WARN "KRT: Route with unexpected iface for %I/%d", net->n.prefix, net->n.pxlen); + 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 { |