From bf97128c7262f17a02fec41cdae75b472ba77f88 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 3 Nov 2009 19:55:11 +0100 Subject: libxtables: hand argv to xtables_check_inverse In going to fix NF bug #611, "argv" is needed in xtables_check_inverse to set "optarg" to the right spot in case of an intrapositional negation. References: http://bugzilla.netfilter.org/show_bug.cgi?id=611 Signed-off-by: Jan Engelhardt --- extensions/libxt_policy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'extensions/libxt_policy.c') diff --git a/extensions/libxt_policy.c b/extensions/libxt_policy.c index 858eaaad..521bac1a 100644 --- a/extensions/libxt_policy.c +++ b/extensions/libxt_policy.c @@ -118,7 +118,7 @@ static int parse_mode(char *s) xtables_error(PARAMETER_PROBLEM, "policy match: invalid mode \"%s\"", s); } -static int policy_parse(int c, int invert, unsigned int *flags, +static int policy_parse(int c, char **argv, int invert, unsigned int *flags, struct xt_policy_info *info, uint8_t family) { struct xt_policy_elem *e = &info->pol[info->len]; @@ -127,7 +127,7 @@ static int policy_parse(int c, int invert, unsigned int *flags, unsigned int naddr = 0, num; int mode; - xtables_check_inverse(optarg, &invert, &optind, 0); + xtables_check_inverse(optarg, &invert, &optind, 0, argv); switch (c) { case '1': @@ -269,14 +269,14 @@ static int policy_parse(int c, int invert, unsigned int *flags, static int policy4_parse(int c, char **argv, int invert, unsigned int *flags, const void *entry, struct xt_entry_match **match) { - return policy_parse(c, invert, flags, (void *)(*match)->data, + return policy_parse(c, argv, invert, flags, (void *)(*match)->data, NFPROTO_IPV4); } static int policy6_parse(int c, char **argv, int invert, unsigned int *flags, const void *entry, struct xt_entry_match **match) { - return policy_parse(c, invert, flags, (void *)(*match)->data, + return policy_parse(c, argv, invert, flags, (void *)(*match)->data, NFPROTO_IPV6); } -- cgit v1.2.3