summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-06-12 20:35:42 +0200
committerJan Engelhardt <jengelh@medozas.de>2009-06-26 21:13:09 +0200
commit92edcb0cf517ddb7976e396eabc7a79f8a1016ba (patch)
treede577d4f65c9b9e7934228411e09c54bcbeb7c15
parentc5e85736c207f211d82d2878a5781f512327dfce (diff)
iptables: allow for parse-less extensions
This means we can do some code removal in extensions. Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
-rw-r--r--ip6tables.c9
-rw-r--r--iptables.c9
2 files changed, 10 insertions, 8 deletions
diff --git a/ip6tables.c b/ip6tables.c
index 31c4b451..71ff46f5 100644
--- a/ip6tables.c
+++ b/ip6tables.c
@@ -1699,13 +1699,14 @@ int do_command6(int argc, char *argv[], char **table, struct ip6tc_handle **hand
exit_tryhelp(2);
default:
- if (!target
- || !(target->parse(c - target->option_offset,
+ if (target == NULL || target->parse == NULL ||
+ !target->parse(c - target->option_offset,
argv, invert,
&target->tflags,
- &fw, &target->t))) {
+ &fw, &target->t)) {
for (matchp = matches; matchp; matchp = matchp->next) {
- if (matchp->completed)
+ if (matchp->completed ||
+ matchp->match->parse == NULL)
continue;
if (matchp->match->parse(c - matchp->match->option_offset,
argv, invert,
diff --git a/iptables.c b/iptables.c
index 7c075dac..cc175767 100644
--- a/iptables.c
+++ b/iptables.c
@@ -1727,13 +1727,14 @@ int do_command(int argc, char *argv[], char **table, struct iptc_handle **handle
exit_tryhelp(2);
default:
- if (!target
- || !(target->parse(c - target->option_offset,
+ if (target == NULL || target->parse == NULL ||
+ !target->parse(c - target->option_offset,
argv, invert,
&target->tflags,
- &fw, &target->t))) {
+ &fw, &target->t)) {
for (matchp = matches; matchp; matchp = matchp->next) {
- if (matchp->completed)
+ if (matchp->completed ||
+ matchp->match->parse == NULL)
continue;
if (matchp->match->parse(c - matchp->match->option_offset,
argv, invert,