summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_policy.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-11-03 19:55:11 +0100
committerJan Engelhardt <jengelh@medozas.de>2009-11-03 21:53:55 +0100
commitbf97128c7262f17a02fec41cdae75b472ba77f88 (patch)
treeadcda9a81323584f04529024c12590f2d41de5e3 /extensions/libxt_policy.c
parent2be22fb36dd1268baecb42ddf35b7a40a6de21d7 (diff)
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 <jengelh@medozas.de>
Diffstat (limited to 'extensions/libxt_policy.c')
-rw-r--r--extensions/libxt_policy.c8
1 files changed, 4 insertions, 4 deletions
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);
}