diff options
author | Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> | 2011-10-27 10:24:48 +0300 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-10-28 21:26:12 +0200 |
commit | 439f75d004644cd4c80b2b5a66b67a9320a8dc27 (patch) | |
tree | 452416d28738a76fed0ed6db9d4d4fc2f0e4e9a5 /tools | |
parent | 7fddd5a9b33817028e889cefb5aa16bfd7997630 (diff) | |
download | connman-439f75d004644cd4c80b2b5a66b67a9320a8dc27.tar.gz connman-439f75d004644cd4c80b2b5a66b67a9320a8dc27.tar.bz2 connman-439f75d004644cd4c80b2b5a66b67a9320a8dc27.zip |
tools: Add matches rule list loading support for iptables_test
Diffstat (limited to 'tools')
-rw-r--r-- | tools/iptables-test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/iptables-test.c b/tools/iptables-test.c index 2c5c6704..65519043 100644 --- a/tools/iptables-test.c +++ b/tools/iptables-test.c @@ -1307,7 +1307,7 @@ static struct xtables_target *prepare_target(struct connman_iptables *table, } static struct xtables_match *prepare_matches(struct connman_iptables *table, - char *match_name) + struct xtables_rule_match **xt_rm, char *match_name) { struct xtables_match *xt_m; size_t match_size; @@ -1315,7 +1315,7 @@ static struct xtables_match *prepare_matches(struct connman_iptables *table, if (match_name == NULL) return NULL; - xt_m = xtables_find_match(match_name, XTF_LOAD_MUST_SUCCEED, NULL); + xt_m = xtables_find_match(match_name, XTF_LOAD_MUST_SUCCEED, xt_rm); match_size = ALIGN(sizeof(struct ipt_entry_match)) + xt_m->size; xt_m->m = g_try_malloc0(match_size); @@ -1351,6 +1351,7 @@ static struct xtables_match *prepare_matches(struct connman_iptables *table, int main(int argc, char *argv[]) { struct connman_iptables *table; + struct xtables_rule_match *xt_rm; struct xtables_match *xt_m; struct xtables_target *xt_t; struct ipt_ip ip; @@ -1371,6 +1372,7 @@ int main(int argc, char *argv[]) delete_chain = flush_chain = NULL; memset(&ip, 0, sizeof(struct ipt_ip)); table = NULL; + xt_rm = NULL; xt_m = NULL; xt_t = NULL; @@ -1562,7 +1564,7 @@ int main(int argc, char *argv[]) goto out; if (match_name != NULL) { - xt_m = prepare_matches(table, match_name); + xt_m = prepare_matches(table, &xt_rm, match_name); if (xt_m == NULL) goto out; } |