diff options
author | Harald Welte <laforge@gnumonks.org> | 2001-01-23 22:46:22 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2001-01-23 22:46:22 +0000 |
commit | 32db524ab38b3258c6bae0b9b7fa76bff544085a (patch) | |
tree | e53721744e37e61245b32b7e6271a80a6ba81f8c /iptables-save.c | |
parent | 42fbb2ea9438ee11682373fe6dae243cf48c5460 (diff) |
fixes segfault in iptables-save
Diffstat (limited to 'iptables-save.c')
-rw-r--r-- | iptables-save.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/iptables-save.c b/iptables-save.c index 2e716e1e..8795cb17 100644 --- a/iptables-save.c +++ b/iptables-save.c @@ -100,14 +100,15 @@ static int non_zero(const void *ptr, size_t size) } #endif -static int print_match(const struct ipt_entry_match *e) +static int print_match(const struct ipt_entry_match *e, + const struct ipt_ip *ip) { struct iptables_match *match = find_match(e->u.user.name, TRY_LOAD); if (match) { printf("-m %s ", e->u.user.name); - match->save(NULL, e); + match->save(ip, e); } else { if (e->u.match_size) { fprintf(stderr, @@ -168,7 +169,7 @@ static void print_rule(const struct ipt_entry *e, /* Print matchinfo part */ if (e->target_offset) { - IPT_MATCH_ITERATE(e, print_match); + IPT_MATCH_ITERATE(e, print_match, &e->ip); } /* Print target name */ @@ -181,7 +182,7 @@ static void print_rule(const struct ipt_entry *e, = find_target(t->u.user.name, TRY_LOAD); if (target) - target->save(NULL, t); + target->save(&e->ip, t); else { /* If some bits are non-zero, it implies we *need* to understand it */ |