0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-12-23 02:01:55 +00:00

Fixes some problems related to link-local routes in KRT interface.

This commit is contained in:
Ondrej Zajicek 2009-10-28 22:39:24 +01:00
parent 9727681a38
commit 9d4d38d1a5
2 changed files with 9 additions and 4 deletions

View File

@ -457,8 +457,6 @@ ospf_lsupd_receive(struct ospf_packet *ps_i, struct ospf_iface *ifa,
/* pg 143 (1) */ /* pg 143 (1) */
chsum = lsa->checksum; chsum = lsa->checksum;
log(L_WARN "Checking rcv %R %R %d (len %d)", ntohl(lsa->id), ntohl(lsa->rt), ntoht(lsa->type), ntohs(lsa->length));
buf_dump("RCV", lsa, ntohs(lsa->length));
if (chsum != lsasum_check(lsa, NULL)) if (chsum != lsasum_check(lsa, NULL))
{ {
log(L_WARN "Received bad lsa checksum from %I: %x %x", n->ip, chsum, lsa->checksum); log(L_WARN "Received bad lsa checksum from %I: %x %x", n->ip, chsum, lsa->checksum);

View File

@ -686,16 +686,23 @@ nl_parse_route(struct nlmsghdr *h, int scan)
} }
if (a[RTA_GATEWAY]) if (a[RTA_GATEWAY])
{ {
struct iface *ifa = if_find_by_index(oif);
neighbor *ng; neighbor *ng;
ra.dest = RTD_ROUTER; ra.dest = RTD_ROUTER;
memcpy(&ra.gw, RTA_DATA(a[RTA_GATEWAY]), sizeof(ra.gw)); memcpy(&ra.gw, RTA_DATA(a[RTA_GATEWAY]), sizeof(ra.gw));
ipa_ntoh(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 && 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; ra.iface = ng->iface;
}
else 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 else
{ {