summaryrefslogtreecommitdiffstats
path: root/xtables.c
diff options
context:
space:
mode:
authorJamal Hadi Salim <hadi@cyberus.ca>2009-02-12 11:43:01 -0500
committerJan Engelhardt <jengelh@medozas.de>2009-02-12 18:58:30 +0100
commit139b3fe4bd5121501e60fe07963ea527d7f0bd36 (patch)
tree02de992cf974ed542414c0ebe5084556257a7fa3 /xtables.c
parent853322131026d62df3f8d77d67e5c63be496303c (diff)
libxtables: make iptables and ip6tables use xtables_free_opts
The patch modifies xtables_globals to introduce orig_opts and xtables_free_opts() to emulate what free_opts used to do. We also get rid of the copies of free_opts() that iptables and ip6tables keep. Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Diffstat (limited to 'xtables.c')
-rw-r--r--xtables.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/xtables.c b/xtables.c
index bc6a65e5..c8024bf2 100644
--- a/xtables.c
+++ b/xtables.c
@@ -97,12 +97,11 @@ int xtables_set_params(struct xtables_globals *xtp)
return 0;
}
-void xtables_free_opts(int reset_offset, struct option *original_opts)
+void xtables_free_opts(int reset_offset)
{
- if (xt_params->opts != original_opts) {
- if (original_opts)
- free(xt_params->opts);
- xt_params->opts = original_opts;
+ if (xt_params->opts != xt_params->orig_opts) {
+ free(xt_params->opts);
+ xt_params->opts = xt_params->orig_opts;
if (reset_offset)
xt_params->option_offset = 0;
}