Commit 8eb70804 authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Allow running with no interfaces given on command line.

parent 82ccad95
......@@ -133,9 +133,9 @@ main(int argc, char **argv)
arg = argv;
SHIFTE();
SHIFT();
while((*arg)[0] == '-') {
while(*arg && (*arg)[0] == '-') {
if(strcmp(*arg, "--") == 0) {
SHIFTE();
break;
......@@ -234,7 +234,7 @@ main(int argc, char **argv)
} else {
goto syntax;
}
SHIFTE();
SHIFT();
}
......@@ -340,19 +340,19 @@ main(int argc, char **argv)
goto fail_pid;
}
{
if(*arg) {
unsigned char dummy[16];
rc = parse_address(*arg, dummy, NULL);
if(rc >= 0) {
fprintf(stderr, "Warning: obsolete router-id given.\n");
SHIFTE();
SHIFT();
}
}
rc = finalise_config();
if(rc < 0) {
fprintf(stderr, "Couldn't finalise configuration.\n");
exit(1);
goto fail;
}
while(*arg) {
......@@ -363,6 +363,11 @@ main(int argc, char **argv)
SHIFT();
}
if(networks == NULL) {
fprintf(stderr, "Eek... asked to run on no interfaces!\n");
goto fail;
}
FOR_ALL_NETS(net) {
/* net->ifindex is not necessarily valid at this point */
int ifindex = if_nametoindex(net->ifname);
......
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