diff options
author | cy <cy@FreeBSD.org> | 2017-02-08 13:37:57 +0000 |
---|---|---|
committer | cy <cy@FreeBSD.org> | 2017-02-08 13:37:57 +0000 |
commit | 249e6c054f1d6534b290a71d3dffc729ff82cf51 (patch) | |
tree | 0a399455790503fcac81bc6b190cb1e56b668dab | |
parent | c897989273d0f8901b36f4f78d0f67bc8dc2e462 (diff) | |
download | FreeBSD-src-249e6c054f1d6534b290a71d3dffc729ff82cf51.zip FreeBSD-src-249e6c054f1d6534b290a71d3dffc729ff82cf51.tar.gz |
MFC r312777, r312780:
Issue an error message when an incorrect flush argument is encountered
(and style fixup).
-rw-r--r-- | contrib/ipfilter/tools/ipf.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/ipfilter/tools/ipf.c b/contrib/ipfilter/tools/ipf.c index 901728b..5de031c 100644 --- a/contrib/ipfilter/tools/ipf.c +++ b/contrib/ipfilter/tools/ipf.c @@ -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; |