Commit 3a4fbbf0 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Apply filters to local addresses too.

parent d5902f09
...@@ -339,7 +339,7 @@ check_xroutes(int send_updates) ...@@ -339,7 +339,7 @@ check_xroutes(int send_updates)
int i, j, change = 0, rc; int i, j, change = 0, rc;
struct kernel_route *routes; struct kernel_route *routes;
struct filter_result filter_result; struct filter_result filter_result;
int numroutes, numaddresses; int numroutes;
static int maxroutes = 8; static int maxroutes = 8;
const int maxmaxroutes = 256 * 1024; const int maxmaxroutes = 256 * 1024;
...@@ -361,8 +361,6 @@ check_xroutes(int send_updates) ...@@ -361,8 +361,6 @@ check_xroutes(int send_updates)
if(numroutes >= maxroutes) if(numroutes >= maxroutes)
goto resize; goto resize;
numaddresses = numroutes;
rc = kernel_routes(routes + numroutes, maxroutes - numroutes); rc = kernel_routes(routes + numroutes, maxroutes - numroutes);
if(rc < 0) if(rc < 0)
fprintf(stderr, "Couldn't get kernel routes.\n"); fprintf(stderr, "Couldn't get kernel routes.\n");
...@@ -372,9 +370,7 @@ check_xroutes(int send_updates) ...@@ -372,9 +370,7 @@ check_xroutes(int send_updates)
if(numroutes >= maxroutes) if(numroutes >= maxroutes)
goto resize; goto resize;
/* Apply filter to kernel routes (e.g. change the source prefix). */ for(i = 0; i < numroutes; i++) {
for(i = numaddresses; i < numroutes; i++) {
routes[i].metric = redistribute_filter(routes[i].prefix, routes[i].plen, routes[i].metric = redistribute_filter(routes[i].prefix, routes[i].plen,
routes[i].src_prefix, routes[i].src_prefix,
routes[i].src_plen, routes[i].src_plen,
......
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