From 7e4db2f50133007f549f222468bde4f3adcf41ac Mon Sep 17 00:00:00 2001 From: Jamal Hadi Salim Date: Fri, 13 Feb 2009 09:14:17 -0500 Subject: 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 --- iptables-standalone.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'iptables-standalone.c') diff --git a/iptables-standalone.c b/iptables-standalone.c index 007f2c2d..6090ea15 100644 --- a/iptables-standalone.c +++ b/iptables-standalone.c @@ -54,9 +54,14 @@ main(int argc, char *argv[]) program_version = IPTABLES_VERSION; xtables_program_name = program_name; - xtables_init(); - xtables_set_nfproto(NFPROTO_IPV4); iptables_globals.program_name = "iptables"; + ret = xtables_init_all(&iptables_globals, NFPROTO_IPV4); + if (ret < 0) { + fprintf(stderr, "%s/%s Failed to initialize xtables\n", + iptables_globals.program_name, + iptables_globals.program_version); + exit(1); + } #ifdef NO_SHARED_LIBS init_extensions(); #endif -- cgit v1.2.3