Author: cy
Date: Wed Feb  8 13:37:57 2017
New Revision: 313441
URL: https://svnweb.freebsd.org/changeset/base/313441

Log:
  MFC r312777, r312780:
  
  Issue an error message when an incorrect flush argument is encountered
  (and style fixup).

Modified:
  stable/11/contrib/ipfilter/tools/ipf.c
Directory Properties:
  stable/11/   (props changed)

Changes in other areas also in this revision:
Modified:
  stable/10/contrib/ipfilter/tools/ipf.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/11/contrib/ipfilter/tools/ipf.c
==============================================================================
--- stable/11/contrib/ipfilter/tools/ipf.c      Wed Feb  8 09:47:38 2017        
(r313440)
+++ stable/11/contrib/ipfilter/tools/ipf.c      Wed Feb  8 13:37:57 2017        
(r313441)
@@ -409,13 +409,16 @@ static void flushfilter(arg, filter)
                closedevice();
                return;
        }
-
-       if (strchr(arg, 'i') || strchr(arg, 'I'))
+       else if (strchr(arg, 'i') || strchr(arg, 'I'))
                fl = FR_INQUE;
-       if (strchr(arg, 'o') || strchr(arg, 'O'))
+       else if (strchr(arg, 'o') || strchr(arg, 'O'))
                fl = FR_OUTQUE;
-       if (strchr(arg, 'a') || strchr(arg, 'A'))
+       else if (strchr(arg, 'a') || strchr(arg, 'A'))
                fl = FR_OUTQUE|FR_INQUE;
+       else {
+               fprintf(stderr, "Incorrect flush argument: %s\n", arg);
+               usage();
+       }
        if (opts & OPT_INACTIVE)
                fl |= FR_INACTIVE;
        rem = fl;
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to