summaryrefslogtreecommitdiffstats
path: root/extensions/libip6t_icmp6.c
diff options
context:
space:
mode:
authorYasuyuki KOZAKAI <yasuyuki@netfilter.org>2006-07-04 10:23:26 +0000
committerYasuyuki KOZAKAI <yasuyuki@netfilter.org>2006-07-04 10:23:26 +0000
commitb1cda88e9440764d8c2bdce72ec9dcffdf68de07 (patch)
tree687a5b65458028e21582e40986b1f8822baedbc6 /extensions/libip6t_icmp6.c
parentb46d0b2d289175b4c37a53531220c3c853117704 (diff)
- force user to specify --icmpv6-type if icmpv6 match is required to load
- Don't allow multiple --icmp-type/icmpv6-type (Closes: #461)
Diffstat (limited to 'extensions/libip6t_icmp6.c')
-rw-r--r--extensions/libip6t_icmp6.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/extensions/libip6t_icmp6.c b/extensions/libip6t_icmp6.c
index a29bb389..6940d0e5 100644
--- a/extensions/libip6t_icmp6.c
+++ b/extensions/libip6t_icmp6.c
@@ -164,11 +164,15 @@ parse(int c, char **argv, int invert, unsigned int *flags,
switch (c) {
case '1':
+ if (*flags == 1)
+ exit_error(PARAMETER_PROBLEM,
+ "icmpv6 match: only use --icmpv6-type once!");
check_inverse(optarg, &invert, &optind, 0);
parse_icmpv6(argv[optind-1], &icmpv6info->type,
icmpv6info->code);
if (invert)
icmpv6info->invflags |= IP6T_ICMP_INV;
+ *flags = 1;
break;
default:
@@ -247,9 +251,11 @@ static void save(const struct ip6t_ip6 *ip, const struct ip6t_entry_match *match
printf(" ");
}
-/* Final check; we don't care. */
static void final_check(unsigned int flags)
{
+ if (!flags)
+ exit_error(PARAMETER_PROBLEM,
+ "icmpv6 match: You must specify `--icmpv6-type'");
}
static struct ip6tables_match icmpv6 = {