diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-10-28 22:39:24 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-10-28 22:39:24 +0100 |
commit | 9d4d38d1a5d67f5485d2b2fa439c879583dfdcb0 (patch) | |
tree | 40e1be3e39126675d4d66c7ceddca4cc0d337497 /sysdep/linux | |
parent | 9727681a38d3a7c474892e167c0e5a4e0cfac844 (diff) | |
download | bird-9d4d38d1a5d67f5485d2b2fa439c879583dfdcb0.tar bird-9d4d38d1a5d67f5485d2b2fa439c879583dfdcb0.zip |
Fixes some problems related to link-local routes in KRT interface.
Diffstat (limited to 'sysdep/linux')
-rw-r--r-- | sysdep/linux/netlink/netlink.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c index 0f7b707..6cfb0ba 100644 --- a/sysdep/linux/netlink/netlink.c +++ b/sysdep/linux/netlink/netlink.c @@ -686,16 +686,23 @@ nl_parse_route(struct nlmsghdr *h, int scan) } if (a[RTA_GATEWAY]) { + struct iface *ifa = if_find_by_index(oif); neighbor *ng; 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); + 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 - /* 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); + return; + } } else { |