Commit e097312d authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use local variables in for_all_*routes.

parent 13e80205
......@@ -320,9 +320,9 @@ flush_interface_routes(struct interface *ifp, int v4only)
void
for_all_routes(void (*f)(struct babel_route*, void*), void *closure)
{
int i;
int i, n = route_slots;
for(i = 0; i < route_slots; i++) {
for(i = 0; i < n; i++) {
struct babel_route *r = routes[i];
while(r) {
(*f)(r, closure);
......@@ -334,9 +334,9 @@ for_all_routes(void (*f)(struct babel_route*, void*), void *closure)
void
for_all_installed_routes(void (*f)(struct babel_route*, void*), void *closure)
{
int i;
int i, n = route_slots;
for(i = 0; i < route_slots; i++) {
for(i = 0; i < n; i++) {
if(routes[i]->installed)
(*f)(routes[i], closure);
}
......
......@@ -129,9 +129,9 @@ xroutes_estimate()
void
for_all_xroutes(void (*f)(struct xroute*, void*), void *closure)
{
int i;
int i, n = numxroutes;
for(i = 0; i < numxroutes; i++)
for(i = 0; i < n; i++)
(*f)(&xroutes[i], closure);
}
......
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