Commit d5902f09 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Ignore redistributed routes filtered out.

Thanks to Dave Taht for the report.
parent 7b13c482
......@@ -391,6 +391,12 @@ check_xroutes(int send_updates)
i = 0;
j = 0;
while(i < numroutes || j < numxroutes) {
/* Ignore routes filtered out. */
if(i < numroutes && routes[i].metric >= INFINITY) {
i++;
continue;
}
if(i >= numroutes)
rc = +1;
else if(j >= numxroutes)
......@@ -444,22 +450,17 @@ check_xroutes(int send_updates)
send_update_resend(NULL, prefix, plen, src_prefix, src_plen);
}
} else {
/* It fits */
if(routes[i].metric >= INFINITY) {
flush_xroute(&xroutes[j]);
} else if(routes[i].metric != xroutes[j].metric ||
routes[i].proto != xroutes[j].proto) {
if(routes[i].metric != xroutes[j].metric ||
routes[i].proto != xroutes[j].proto) {
xroutes[j].metric = routes[i].metric;
xroutes[j].proto = routes[i].proto;
local_notify_xroute(&xroutes[j], LOCAL_CHANGE);
if(send_updates)
send_update(NULL, 0, xroutes[j].prefix, xroutes[j].plen,
xroutes[j].src_prefix, xroutes[j].src_plen);
j++;
} else {
j++;
}
i++;
j++;
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment