Author: cy
Date: Fri Jul 17 19:07:53 2020
New Revision: 363283
URL: https://svnweb.freebsd.org/changeset/base/363283

Log:
  -4 and -6 only make sense with -i, -o, and -t.
  
  PR:           247952
  MFC after:    1 week

Modified:
  head/contrib/ipfilter/tools/ipfstat.c

Modified: head/contrib/ipfilter/tools/ipfstat.c
==============================================================================
--- head/contrib/ipfilter/tools/ipfstat.c       Fri Jul 17 19:07:50 2020        
(r363282)
+++ head/contrib/ipfilter/tools/ipfstat.c       Fri Jul 17 19:07:53 2020        
(r363283)
@@ -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
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to