Commit 740e8228 authored by Matthieu Boutier's avatar Matthieu Boutier Committed by Juliusz Chroboczek

Filter: Rename "result" to "add_metric".

The field "result" is in fact an additional cost.
parent 2c93a100
......@@ -346,16 +346,16 @@ parse_filter(int c, gnc_t gnc, void *closure, struct filter **filter_return)
filter->ifname = interface;
filter->ifindex = if_nametoindex(interface);
} else if(strcmp(token, "allow") == 0) {
filter->result = 0;
filter->add_metric = 0;
} else if(strcmp(token, "deny") == 0) {
filter->result = INFINITY;
filter->add_metric = INFINITY;
} else if(strcmp(token, "metric") == 0) {
int metric;
c = getint(c, &metric, gnc, closure);
if(c < -1) goto error;
if(metric <= 0 || metric > INFINITY)
goto error;
filter->result = metric;
filter->add_metric = metric;
} else {
goto error;
}
......@@ -929,7 +929,7 @@ do_filter(struct filter *f, const unsigned char *id,
{
while(f) {
if(filter_match(f, id, prefix, plen, neigh, ifindex, proto))
return f->result;
return f->add_metric;
f = f->next;
}
return -1;
......
......@@ -30,7 +30,7 @@ struct filter {
unsigned char plen_ge, plen_le;
unsigned char *neigh;
int proto; /* May be negative */
unsigned int result;
unsigned int add_metric;
struct filter *next;
};
......
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