summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-10-27 07:24:54 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-28 19:26:12 (GMT)
commitb21f0072851bc6807fee04bd06ff2e4dd40e7372 (patch)
tree2b9b2f1ec54e712884c6413fd198974bf3f39965 /tools
parentd525bbfe27dd955c4102ff744fbd6f7e2556ba73 (diff)
downloadconnman-b21f0072851bc6807fee04bd06ff2e4dd40e7372.zip
connman-b21f0072851bc6807fee04bd06ff2e4dd40e7372.tar.gz
connman-b21f0072851bc6807fee04bd06ff2e4dd40e7372.tar.bz2
tools: Add extensions options parsing for matches to iptables-test
Diffstat (limited to 'tools')
-rw-r--r--tools/iptables-test.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index 9ccee9d..82e1dbb 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -1375,8 +1375,8 @@ done:
int main(int argc, char *argv[])
{
struct connman_iptables *table;
- struct xtables_rule_match *xt_rm;
- struct xtables_match *xt_m;
+ struct xtables_rule_match *xt_rm, *tmp_xt_rm;
+ struct xtables_match *xt_m, *xt_m_t;
struct xtables_target *xt_t;
struct ipt_ip ip;
char *table_name, *chain, *new_chain, *match_name, *target_name;
@@ -1540,6 +1540,28 @@ int main(int argc, char *argv[])
XT_OPTION_OFFSET_SCALE)) {
xtables_option_tpcall(c, argv,
invert, xt_t, NULL);
+
+ break;
+ }
+
+ for (tmp_xt_rm = xt_rm; tmp_xt_rm != NULL;
+ tmp_xt_rm = tmp_xt_rm->next) {
+ xt_m_t = tmp_xt_rm->match;
+
+ if (tmp_xt_rm->completed ||
+ (xt_m_t->x6_parse == NULL &&
+ xt_m_t->parse == NULL))
+ continue;
+
+ if (c < (int) xt_m_t->option_offset ||
+ c >= (int) xt_m_t->option_offset
+ + XT_OPTION_OFFSET_SCALE)
+ continue;
+
+ xtables_option_mpcall(c, argv,
+ invert, xt_m_t, NULL);
+
+ break;
}
break;