diff options
author | Jamal Hadi Salim <hadi@cyberus.ca> | 2009-02-13 09:14:17 -0500 |
---|---|---|
committer | Jan Engelhardt <jengelh@medozas.de> | 2009-02-13 15:46:52 +0100 |
commit | 7e4db2f50133007f549f222468bde4f3adcf41ac (patch) | |
tree | 161425eb53b09d37cc86f961fdb1760548b8e338 /ip6tables-restore.c | |
parent | 70581922f873a88306dd5b1cb83c5081ee239eb8 (diff) |
libxtables: consolidate init calls into one function
Introduce xtables_init_all() which hides three calls xtables_init(),
xtables_set_nfproto(), and xtables_set_params(). Make
ip[6]tables-restore, ip[6]tables-save and ip[6]tables-standalone use
it.
I moved xtables_set_params around for readability reasons.
Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Diffstat (limited to 'ip6tables-restore.c')
-rw-r--r-- | ip6tables-restore.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/ip6tables-restore.c b/ip6tables-restore.c index 3d535def..0f06a1c0 100644 --- a/ip6tables-restore.c +++ b/ip6tables-restore.c @@ -131,9 +131,14 @@ int main(int argc, char *argv[]) line = 0; xtables_program_name = program_name; - xtables_init(); - xtables_set_nfproto(NFPROTO_IPV6); ip6tables_globals.program_name = "ip6tables-restore"; + c = xtables_init_all(&ip6tables_globals, NFPROTO_IPV6); + if (c < 0) { + fprintf(stderr, "%s/%s Failed to initialize xtables\n", + ip6tables_globals.program_name, + ip6tables_globals.program_version); + exit(1); + } #ifdef NO_SHARED_LIBS init_extensions(); #endif |