summaryrefslogtreecommitdiffstats
path: root/iptables-standalone.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2000-12-01 14:26:20 +0000
committerHarald Welte <laforge@gnumonks.org>2000-12-01 14:26:20 +0000
commitae1ff9f96a80379a650dec979b9902528a10d45a (patch)
treee08f8825fc4f328c8fa518ccab7028fab526c63e /iptables-standalone.c
parentc82e9ac60540a9b25cb5ab60f603606dc208d318 (diff)
make iptables-restore and iptables-save work again!
Diffstat (limited to 'iptables-standalone.c')
-rw-r--r--iptables-standalone.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/iptables-standalone.c b/iptables-standalone.c
index dfbc0fa3..53d21890 100644
--- a/iptables-standalone.c
+++ b/iptables-standalone.c
@@ -33,14 +33,21 @@ main(int argc, char *argv[])
{
int ret;
char *table = "filter";
- iptc_handle_t handle;
+ iptc_handle_t *handle;
+
+ handle = (iptc_handle_t *) malloc(sizeof(iptc_handle_t));
+ if (!handle) {
+ fprintf(stderr, "out of memory\n");
+ exit(1);
+ }
+ memset(handle, 0, sizeof(iptc_handle_t));
program_name = "iptables";
program_version = NETFILTER_VERSION;
- ret = do_command(argc, argv, &table, &handle);
+ ret = do_command(argc, argv, &table, handle);
if (ret)
- ret = iptc_commit(&handle);
+ ret = iptc_commit(handle);
if (!ret)
fprintf(stderr, "iptables: %s\n",