summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-10-27 10:24:52 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-28 21:26:12 +0200
commitdc44407d75850208300cd997aeb6f74aa4f85b6c (patch)
treec576ef0c296d4521709bc6ff35a3c359868c32c4 /tools
parentd3f6815dd1935d44d96ee3847b9f0a41e8b87908 (diff)
downloadconnman-dc44407d75850208300cd997aeb6f74aa4f85b6c.tar.gz
connman-dc44407d75850208300cd997aeb6f74aa4f85b6c.tar.bz2
connman-dc44407d75850208300cd997aeb6f74aa4f85b6c.zip
tools: Add extensions options parsing for target to iptables_test
Diffstat (limited to 'tools')
-rw-r--r--tools/iptables-test.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index 56598aad..ac50823e 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -46,6 +46,8 @@ static const char *hooknames[] = {
#define LABEL_QUEUE "QUEUE"
#define LABEL_RETURN "RETURN"
+#define XT_OPTION_OFFSET_SCALE 256
+
/* fn returns 0 to continue iteration */
#define _XT_ENTRY_ITERATE_CONTINUE(type, entries, size, n, fn, args...) \
({ \
@@ -1531,14 +1533,13 @@ int main(int argc, char *argv[])
return -1;
default:
- if (xt_t == NULL || xt_t->parse == NULL ||
- !xt_t->parse(c - xt_t->option_offset, argv, invert,
- &xt_t->tflags, NULL, &xt_t->t)) {
- if (xt_m == NULL || xt_m->parse == NULL)
- break;
-
- xt_m->parse(c - xt_m->option_offset, argv,
- invert, &xt_m->mflags, NULL, &xt_m->m);
+ if (xt_t != NULL && (xt_t->x6_parse != NULL ||
+ xt_t->parse != NULL) &&
+ (c >= (int) xt_t->option_offset &&
+ c < (int) xt_t->option_offset +
+ XT_OPTION_OFFSET_SCALE)) {
+ xtables_option_tpcall(c, argv,
+ invert, xt_t, NULL);
}
break;