Skip to content

Commit

Permalink
Merge pull request #47 from evverx/fake_router26_debug
Browse files Browse the repository at this point in the history
fake_router26: allow passing -V to turn on the debug mode
  • Loading branch information
vanhauser-thc committed Jan 1, 2023
2 parents ccda619 + 2243569 commit e60add3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions fake_router26.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void help(char *prg) {
printf(
"Syntax: %s [-E type] [-A network/prefix] [-R network/prefix] [-D "
"dns-server] [-s sourceip] [-S sourcemac] [-ardl seconds] [-Tt ms] [-n "
"no] [-i interval] interface [target]\n\n",
"no] [-i interval] [-V] interface [target]\n\n",
prg);
printf("Options:\n");
printf(" -A network/prefix add autoconfiguration network (up to %d times)\n",
Expand Down Expand Up @@ -96,6 +96,7 @@ void help(char *prg) {
printf(
" -X clean up by de-announcing fake router (default: "
"disabled)\n");
printf(" -V enable debug output\n");
printf(
"\nAnnounce yourself as a router and try to become the default "
"router.\n");
Expand Down Expand Up @@ -187,7 +188,7 @@ int main(int argc, char *argv[]) {
memset(mac, 0, sizeof(mac));

while ((i = getopt(argc, argv,
"i:r:E:R:M:m:S:s:D:L:A:a:r:d:t:T:p:n:l:F:Xf:")) >= 0) {
"i:r:E:R:M:m:S:s:D:L:A:a:r:d:t:T:p:n:l:F:Xf:V")) >= 0) {
switch (i) {
case 'i':
interval = atoi(optarg);
Expand Down Expand Up @@ -434,6 +435,9 @@ int main(int argc, char *argv[]) {
case 'X':
do_cleanup = 1;
break;
case 'V':
debug = 1;
break;
default:
fprintf(stderr, "Error: invalid option %c\n", i);
exit(-1);
Expand Down

0 comments on commit e60add3

Please sign in to comment.