Skip to content

Commit

Permalink
Merge pull request #154 from pbhenson/fix_-4_bug
Browse files Browse the repository at this point in the history
Fix -4 option when IPv6 disabled
  • Loading branch information
schweikert committed Dec 31, 2019
2 parents 39a567d + 509f5a5 commit 88963eb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/fping.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,13 @@ int main(int argc, char** argv)
while ((c = optparse_long(&optparse_state, longopts, NULL)) != EOF) {
switch (c) {
case '4':
#ifdef IPV6
if (hints_ai_family != AF_UNSPEC) {
fprintf(stderr, "%s: can't specify both -4 and -6\n", prog);
exit(1);
}
hints_ai_family = AF_INET;
#endif
break;
case '6':
#ifdef IPV6
Expand Down

0 comments on commit 88963eb

Please sign in to comment.