Commit 1da98196 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Remove support for inherit filters.

It doesn't appear to be useful, and complicates uselessly complicates matters.
parent 123f9ffb
......@@ -240,8 +240,6 @@ parse_filter(gnc_t gnc, void *closure)
if(metric <= 0 || metric > INFINITY)
goto error;
filter->result = metric;
} else if(strcmp(token, "inherit") == 0) {
filter->result = METRIC_INHERIT;
} else {
goto error;
}
......@@ -453,7 +451,7 @@ input_filter(const unsigned char *id,
{
int res;
res = do_filter(input_filters, id, prefix, plen, neigh, ifindex, 0);
if(res < 0 || res == METRIC_INHERIT)
if(res < 0)
res = 0;
return res;
}
......@@ -464,7 +462,7 @@ output_filter(const unsigned char *id, const unsigned char *prefix,
{
int res;
res = do_filter(output_filters, id, prefix, plen, NULL, ifindex, 0);
if(res < 0 || res == METRIC_INHERIT)
if(res < 0)
res = 0;
return res;
}
......
......@@ -20,8 +20,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#define METRIC_INHERIT (INFINITY + 1)
struct filter {
int af;
char *ifname;
......
......@@ -162,8 +162,7 @@ check_xroutes(int send_updates)
export = 0;
metric = redistribute_filter(xroutes[i].prefix, xroutes[i].plen,
xroutes[i].ifindex, xroutes[i].proto);
if((metric < INFINITY && metric == xroutes[i].metric) ||
metric == METRIC_INHERIT) {
if(metric < INFINITY && metric == xroutes[i].metric) {
for(j = 0; j < numroutes; j++) {
if(xroutes[i].plen == routes[j].plen &&
memcmp(xroutes[i].prefix, routes[j].prefix, 16) == 0 &&
......@@ -172,10 +171,6 @@ check_xroutes(int send_updates)
if(metric < INFINITY) {
export = 1;
break;
} else if(metric == METRIC_INHERIT &&
xroutes[i].metric == routes[j].metric * 256) {
export = 1;
break;
}
}
}
......@@ -207,8 +202,6 @@ check_xroutes(int send_updates)
continue;
metric = redistribute_filter(routes[i].prefix, routes[i].plen,
routes[i].ifindex, routes[i].proto);
if(metric == METRIC_INHERIT)
metric = routes[i].metric * 256;
if(metric < INFINITY) {
rc = add_xroute(routes[i].prefix, routes[i].plen,
metric, routes[i].ifindex, routes[i].proto);
......
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