diff options
author | Jan Engelhardt <jengelh@medozas.de> | 2011-06-18 21:18:29 +0200 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2011-06-21 17:05:11 +0200 |
commit | 14190986f87301b18bcc473c842bd82d778d87a2 (patch) | |
tree | 6f3aa579a7e75023d929bc04b482cac98ce20262 /iptables/xshared.c | |
parent | 68818f746bf9c68de04a75fbe756bf2c73e0fb32 (diff) |
iptables: consolidate target/match init call
This is useful for the upcoming patch about per-instance auxiliary
data.
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'iptables/xshared.c')
-rw-r--r-- | iptables/xshared.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/iptables/xshared.c b/iptables/xshared.c index 0e3857bb..55ce5504 100644 --- a/iptables/xshared.c +++ b/iptables/xshared.c @@ -145,8 +145,7 @@ int command_default(struct iptables_command_state *cs, m->m->u.match_size = size; strcpy(m->m->u.user.name, m->name); m->m->u.user.revision = m->revision; - if (m->init != NULL) - m->init(m->m); + xs_init_match(m); if (m->x6_options != NULL) gl->opts = xtables_options_xfrm(gl->orig_opts, @@ -207,3 +206,15 @@ int subcmd_main(int argc, char **argv, const struct subcommand *cb) fprintf(stderr, " * %s\n", cb->name); exit(EXIT_FAILURE); } + +void xs_init_target(struct xtables_target *target) +{ + if (target->init != NULL) + target->init(target->t); +} + +void xs_init_match(struct xtables_match *match) +{ + if (match->init != NULL) + match->init(match->m); +} |