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

Do not allow gateway routes with NULL iface.

This commit is contained in:
Ondrej Zajicek 2009-09-24 19:08:14 +02:00
parent 54fe0d9230
commit 2d507e64b7
3 changed files with 12 additions and 5 deletions

View File

@ -339,7 +339,10 @@ krt_read_rt(struct ks_msg *msg, struct krt_proto *p, int scan)
if (ng && ng->scope) if (ng && ng->scope)
a.iface = ng->iface; a.iface = ng->iface;
else else
log(L_WARN "Kernel told us to use non-neighbor %I for %I/%d", igate, 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.dest = RTD_ROUTER;
a.gw = igate; a.gw = igate;

View File

@ -103,8 +103,10 @@ krt_parse_entry(byte *ent, struct krt_proto *p)
if (ng && ng->scope) if (ng && ng->scope)
a.iface = ng->iface; a.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", 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.dest = RTD_ROUTER;
a.gw = gw; a.gw = gw;
} }

View File

@ -686,8 +686,10 @@ nl_parse_route(struct nlmsghdr *h, int scan)
if (ng && ng->scope) if (ng && ng->scope)
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
{ {