summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2011-10-27 10:24:46 +0300
committerSamuel Ortiz <sameo@linux.intel.com>2011-10-28 21:26:12 +0200
commit1e1cf8166f48eef131738d672292750e32301d73 (patch)
tree2378691d1db192a62883a8b753ae0b5372438d79 /tools
parent2e6ef28ed043cce4dfc268f9d40f06815d636021 (diff)
downloadconnman-1e1cf8166f48eef131738d672292750e32301d73.tar.gz
connman-1e1cf8166f48eef131738d672292750e32301d73.tar.bz2
connman-1e1cf8166f48eef131738d672292750e32301d73.zip
tools: Move iptables_test target options merge in prepare_target
Diffstat (limited to 'tools')
-rw-r--r--tools/iptables-test.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/tools/iptables-test.c b/tools/iptables-test.c
index a29a1a00..5ee1ec39 100644
--- a/tools/iptables-test.c
+++ b/tools/iptables-test.c
@@ -1289,6 +1289,20 @@ static struct xtables_target *prepare_target(struct connman_iptables *table,
xt_t->init(xt_t->t);
}
+ connman_iptables_globals.opts =
+ xtables_merge_options(
+#if XTABLES_VERSION_CODE > 5
+ connman_iptables_globals.orig_opts,
+#endif
+ connman_iptables_globals.opts,
+ xt_t->extra_opts,
+ &xt_t->option_offset);
+
+ if (connman_iptables_globals.opts == NULL) {
+ g_free(xt_t->t);
+ xt_t = NULL;
+ }
+
return xt_t;
}
@@ -1530,17 +1544,6 @@ int main(int argc, char *argv[])
if (xt_t == NULL)
goto out;
- connman_iptables_globals.opts =
- xtables_merge_options(
-#if XTABLES_VERSION_CODE > 5
- connman_iptables_globals.orig_opts,
-#endif
- connman_iptables_globals.opts,
- xt_t->extra_opts,
- &xt_t->option_offset);
- if (connman_iptables_globals.opts == NULL)
- goto out;
-
if (delete_rule == TRUE) {
printf("Deleting %s to %s (match %s)\n", target_name,
chain, match_name);