Commit 231b2802 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Revert "Fix handling of infinite results from install_filter."

This reverts commit 580257c7.
parent d3734a10
...@@ -444,24 +444,19 @@ change_route(int operation, const struct babel_route *route, int metric, ...@@ -444,24 +444,19 @@ change_route(int operation, const struct babel_route *route, int metric,
int new_ifindex, int new_metric) int new_ifindex, int new_metric)
{ {
struct filter_result filter_result; struct filter_result filter_result;
unsigned char *pref_src = NULL;
unsigned int ifindex = route->neigh->ifp->ifindex; unsigned int ifindex = route->neigh->ifp->ifindex;
int m = install_filter(route->src->prefix, route->src->plen, int m = install_filter(route->src->prefix, route->src->plen,
route->src->src_prefix, route->src->src_plen, route->src->src_prefix, route->src->src_plen,
ifindex, &filter_result); ifindex, &filter_result);
if(m >= INFINITY) { if (m < INFINITY)
if(operation == ROUTE_ADD) pref_src = filter_result.pref_src;
return 0;
else if(operation == ROUTE_MODIFY) {
operation = ROUTE_FLUSH;
}
}
int table = filter_result.table ? filter_result.table : export_table; int table = filter_result.table ? filter_result.table : export_table;
return kernel_route(operation, table, route->src->prefix, route->src->plen, return kernel_route(operation, table, route->src->prefix, route->src->plen,
route->src->src_prefix, route->src->src_plen, route->src->src_prefix, route->src->src_plen, pref_src,
filter_result.pref_src,
route->nexthop, ifindex, route->nexthop, ifindex,
metric, new_next_hop, new_ifindex, new_metric, metric, new_next_hop, new_ifindex, new_metric,
operation == ROUTE_MODIFY ? table : 0); operation == ROUTE_MODIFY ? table : 0);
......
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