Skip to content

Commit

Permalink
Allow IPv4 and IPv6 only on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
angt committed Jul 15, 2016
1 parent 1286b0f commit 00ee23b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,11 @@ int main (int argc, char **argv)
long time_tolerance = 0;

int v4 = 1;
int v6 = 1;
int v6 = 0;

#ifdef __linux__
v6 = 1;
#endif

struct option opts[] = {
{ "host", &host, option_str },
Expand Down Expand Up @@ -281,13 +285,18 @@ int main (int argc, char **argv)
return 0;
}

if (option_is_set(opts, "v4only"))
if (option_is_set(opts, "v4only")) {
v4 = 1;
v6 = 0;
}

if (option_is_set(opts, "v6only"))
if (option_is_set(opts, "v6only")) {
v4 = 0;
v6 = 1;
}

if (!v4 && !v6) {
if (option_is_set(opts, "v4only") &&
option_is_set(opts, "v6only")) {
gt_log("v4only and v6only are both set\n");
return 1;
}
Expand Down

0 comments on commit 00ee23b

Please sign in to comment.