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) ...@@ -391,6 +391,12 @@ check_xroutes(int send_updates)
i = 0; i = 0;
j = 0; j = 0;
while(i < numroutes || j < numxroutes) { while(i < numroutes || j < numxroutes) {
/* Ignore routes filtered out. */
if(i < numroutes && routes[i].metric >= INFINITY) {
i++;
continue;
}
if(i >= numroutes) if(i >= numroutes)
rc = +1; rc = +1;
else if(j >= numxroutes) else if(j >= numxroutes)
...@@ -444,22 +450,17 @@ check_xroutes(int send_updates) ...@@ -444,22 +450,17 @@ check_xroutes(int send_updates)
send_update_resend(NULL, prefix, plen, src_prefix, src_plen); send_update_resend(NULL, prefix, plen, src_prefix, src_plen);
} }
} else { } else {
/* It fits */ if(routes[i].metric != xroutes[j].metric ||
if(routes[i].metric >= INFINITY) { routes[i].proto != xroutes[j].proto) {
flush_xroute(&xroutes[j]);
} else if(routes[i].metric != xroutes[j].metric ||
routes[i].proto != xroutes[j].proto) {
xroutes[j].metric = routes[i].metric; xroutes[j].metric = routes[i].metric;
xroutes[j].proto = routes[i].proto; xroutes[j].proto = routes[i].proto;
local_notify_xroute(&xroutes[j], LOCAL_CHANGE); local_notify_xroute(&xroutes[j], LOCAL_CHANGE);
if(send_updates) if(send_updates)
send_update(NULL, 0, xroutes[j].prefix, xroutes[j].plen, send_update(NULL, 0, xroutes[j].prefix, xroutes[j].plen,
xroutes[j].src_prefix, xroutes[j].src_plen); xroutes[j].src_prefix, xroutes[j].src_plen);
j++;
} else {
j++;
} }
i++; 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