Commit 0858666b authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use RTPROT_BABEL_LOCAL throughout.

parent e66658b0
......@@ -32,6 +32,8 @@ THE SOFTWARE.
#define RTPROT_BABEL 42
#endif
#define RTPROT_BABEL_LOCAL -2
#undef MAX
#undef MIN
......
......@@ -217,7 +217,7 @@ parse_filter(gnc_t gnc, void *closure)
goto error;
filter->proto = proto;
} else if(strcmp(token, "local") == 0) {
filter->proto = PROTO_LOCAL;
filter->proto = RTPROT_BABEL_LOCAL;
} else if(strcmp(token, "if") == 0) {
char *interface;
c = getword(c, &interface, gnc, closure);
......@@ -422,7 +422,7 @@ filter_match(struct filter *f, const unsigned char *id,
if(f->proto) {
if(!proto || f->proto != proto)
return 0;
} else if(proto == PROTO_LOCAL) {
} else if(proto == RTPROT_BABEL_LOCAL) {
return 0;
}
return 1;
......
......@@ -22,8 +22,6 @@ THE SOFTWARE.
#define METRIC_INHERIT (INFINITY + 1)
#define PROTO_LOCAL -2
struct filter {
int af;
char *ifname;
......
......@@ -24,8 +24,6 @@ THE SOFTWARE.
#define KERNEL_INFINITY 0xFFFF
#define RTPROTO_BABEL_LOCAL 257
struct kernel_route {
unsigned char prefix[16];
int plen;
......
......@@ -1101,7 +1101,7 @@ filter_addresses(struct nlmsghdr *nh, void *data)
route->plen = 128;
route->metric = 0;
route->ifindex = ifa->ifa_index;
route->proto = RTPROTO_BABEL_LOCAL;
route->proto = RTPROT_BABEL_LOCAL;
memset(route->gw, 0, 16);
*found = (*found)+1;
}
......
......@@ -134,7 +134,8 @@ check_xroutes()
export = 1;
} else if(xroutes[i].kind == XROUTE_LOCAL) {
metric = redistribute_filter(xroutes[i].prefix, xroutes[i].plen,
xroutes[i].ifindex, PROTO_LOCAL);
xroutes[i].ifindex,
RTPROT_BABEL_LOCAL);
if(metric == METRIC_INHERIT)
metric = 0;
if(metric < INFINITY && metric == xroutes[i].metric) {
......@@ -187,13 +188,13 @@ check_xroutes()
if(martian_prefix(addresses[i].prefix, addresses[i].plen))
continue;
metric = redistribute_filter(addresses[i].prefix, addresses[i].plen,
addresses[i].ifindex, PROTO_LOCAL);
addresses[i].ifindex, RTPROT_BABEL_LOCAL);
if(metric == METRIC_INHERIT)
metric = 0;
if(metric < INFINITY) {
rc = add_xroute(XROUTE_LOCAL,
addresses[i].prefix, addresses[i].plen,
0, addresses[i].ifindex, PROTO_LOCAL);
0, addresses[i].ifindex, RTPROT_BABEL_LOCAL);
if(rc)
change = 1;
}
......
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