Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Feb 2017 13:37:57 +0000 (UTC)
From:      Cy Schubert <cy@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r313441 - in stable: 10/contrib/ipfilter/tools 11/contrib/ipfilter/tools
Message-ID:  <201702081337.v18Dbvla078198@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201702081337.v18Dbvla078198>