summaryrefslogtreecommitdiffstats
path: root/ip6tables-restore.c
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2008-11-10 17:00:41 +0100
committerPatrick McHardy <kaber@trash.net>2008-11-10 17:00:41 +0100
commit1c9015b2cb483678f153121255e10ec0bbfde3e6 (patch)
treeceb7afdf25de51701556fffc7469bc7c4c270570 /ip6tables-restore.c
parentfd1873110f8e57be578df17fc9d03536b10f4f73 (diff)
libiptc: remove indirections
Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Patrick McHardy <kaber@trash.net>
Diffstat (limited to 'ip6tables-restore.c')
-rw-r--r--ip6tables-restore.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/ip6tables-restore.c b/ip6tables-restore.c
index d2a9df3c..0daae5f0 100644
--- a/ip6tables-restore.c
+++ b/ip6tables-restore.c
@@ -199,7 +199,9 @@ int main(int argc, char *argv[])
} else if ((strcmp(buffer, "COMMIT\n") == 0) && (in_table)) {
if (!testing) {
DEBUGP("Calling commit\n");
- ret = ip6tc_commit(&handle);
+ ret = ip6tc_commit(handle);
+ ip6tc_free(handle);
+ handle = NULL;
} else {
DEBUGP("Not calling commit, testing\n");
ret = 1;
@@ -221,19 +223,19 @@ int main(int argc, char *argv[])
curtable[IP6T_TABLE_MAXNAMELEN] = '\0';
if (handle)
- ip6tc_free(&handle);
+ ip6tc_free(handle);
handle = create_handle(table, modprobe);
if (noflush == 0) {
DEBUGP("Cleaning all chains of table '%s'\n",
table);
for_each_chain(flush_entries, verbose, 1,
- &handle);
+ handle);
DEBUGP("Deleting all user-defined chains "
"of table '%s'\n", table);
for_each_chain(delete_chain, verbose, 0,
- &handle) ;
+ handle);
}
ret = 1;
@@ -255,14 +257,14 @@ int main(int argc, char *argv[])
if (ip6tc_builtin(chain, handle) <= 0) {
if (noflush && ip6tc_is_chain(chain, handle)) {
DEBUGP("Flushing existing user defined chain '%s'\n", chain);
- if (!ip6tc_flush_entries(chain, &handle))
+ if (!ip6tc_flush_entries(chain, handle))
exit_error(PARAMETER_PROBLEM,
"error flushing chain "
"'%s':%s\n", chain,
strerror(errno));
} else {
DEBUGP("Creating new chain '%s'\n", chain);
- if (!ip6tc_create_chain(chain, &handle))
+ if (!ip6tc_create_chain(chain, handle))
exit_error(PARAMETER_PROBLEM,
"error creating chain "
"'%s':%s\n", chain,
@@ -300,7 +302,7 @@ int main(int argc, char *argv[])
chain, policy);
if (!ip6tc_set_policy(chain, policy, &count,
- &handle))
+ handle))
exit_error(OTHER_PROBLEM,
"Can't set policy `%s'"
" on `%s' line %u: %s\n",