diff options
author | Patrick McHardy <kaber@trash.net> | 2004-09-18 17:43:36 +0000 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2004-09-18 17:43:36 +0000 |
commit | d0a2e8adfaa8bc60f2c52f64ab32ca11d00e49db (patch) | |
tree | 0fe0f2d489fd7c02daed2ec2b67db122b3aa7e20 /extensions/libipt_multiport.c | |
parent | 13218fbdc92e704953d01333ea10bd623821b71e (diff) |
Print error when '!' is used with multiport. Based on patch by Phil Oester.
Diffstat (limited to 'extensions/libipt_multiport.c')
-rw-r--r-- | extensions/libipt_multiport.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/extensions/libipt_multiport.c b/extensions/libipt_multiport.c index c9a98b3b..efcb58ea 100644 --- a/extensions/libipt_multiport.c +++ b/extensions/libipt_multiport.c @@ -112,6 +112,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, switch (c) { case '1': + check_inverse(argv[optind-1], &invert, &optind, 0); proto = check_proto(entry); multiinfo->count = parse_multi_ports(argv[optind-1], multiinfo->ports, proto); @@ -120,6 +121,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, break; case '2': + check_inverse(argv[optind-1], &invert, &optind, 0); proto = check_proto(entry); multiinfo->count = parse_multi_ports(argv[optind-1], multiinfo->ports, proto); @@ -128,6 +130,7 @@ parse(int c, char **argv, int invert, unsigned int *flags, break; case '3': + check_inverse(argv[optind-1], &invert, &optind, 0); proto = check_proto(entry); multiinfo->count = parse_multi_ports(argv[optind-1], multiinfo->ports, proto); @@ -139,6 +142,10 @@ parse(int c, char **argv, int invert, unsigned int *flags, return 0; } + if (invert) + exit_error(PARAMETER_PROBLEM, + "multiport does not support invert"); + if (*flags) exit_error(PARAMETER_PROBLEM, "multiport can only have one option"); |