-4 and -6 only make sense with -i, -o, and -t.

PR:		247952
MFC after:	1 week
This commit is contained in:
Cy Schubert 2020-07-17 19:07:53 +00:00
parent ebdefe6cb4
commit 64a1886d5c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=363283

View File

@ -394,6 +394,15 @@ int main(argc,argv)
}
}
#ifdef USE_INET6
if ((use_inet4 || use_inet6) &&
!(opts & (OPT_INQUE | OPT_OUTQUE | OPT_STATETOP))) {
#ifdef STATETOP
FPRINTF(stderr, "No -i, -o, or -t given with -4 or -6\n");
#else
FPRINTF(stderr, "No -i or -o given with -4 or -6\n");
#endif
exit(-2);
}
if (use_inet4 == 0 && use_inet6 == 0)
use_inet4 = use_inet6 = 1;
#endif