Commit cd2c3bfd authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Use add_xroute for -X.

parent 832b4357
...@@ -135,28 +135,27 @@ main(int argc, char **argv) ...@@ -135,28 +135,27 @@ main(int argc, char **argv)
SHIFTE(); SHIFTE();
protocol_port = atoi(*arg); protocol_port = atoi(*arg);
} else if(strcmp(*arg, "-X") == 0) { } else if(strcmp(*arg, "-X") == 0) {
if(numxroutes >= MAXXROUTES) { int metric;
fprintf(stderr, "Too many exported routes.\n"); unsigned char prefix[16];
exit(1); unsigned char plen;
}
SHIFTE(); SHIFTE();
rc = parse_net(*arg, rc = parse_net(*arg, prefix, &plen, NULL);
xroutes[numxroutes].prefix,
&xroutes[numxroutes].plen, NULL);
if(rc < 0) if(rc < 0)
goto syntax; goto syntax;
SHIFTE(); SHIFTE();
if(strcmp(*arg, "infinity") == 0) if(strcmp(*arg, "infinity") == 0)
xroutes[numxroutes].metric = INFINITY; metric = INFINITY;
else { else {
int metric = atoi(*arg); metric = atoi(*arg);
if(metric < 0 || metric > INFINITY) if(metric < 0 || metric > INFINITY)
goto syntax; goto syntax;
xroutes[numxroutes].metric = metric;
} }
xroutes[numxroutes].kind = XROUTE_FORCED; rc = add_xroute(XROUTE_FORCED, prefix, plen, metric, 0, 0);
xroutes[numxroutes].ifindex = 0; if(rc < 0) {
numxroutes++; fprintf(stderr, "Couldn't add xroute.\n");
exit(1);
}
} else if(strcmp(*arg, "-h") == 0) { } else if(strcmp(*arg, "-h") == 0) {
SHIFTE(); SHIFTE();
wireless_hello_interval = atoi(*arg); wireless_hello_interval = atoi(*arg);
......
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