diff options
-rw-r--r-- | src/ipset.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/ipset.c b/src/ipset.c index d4cf7b8..8ed3e10 100644 --- a/src/ipset.c +++ b/src/ipset.c @@ -431,14 +431,6 @@ parse_commandline(int argc, char *argv[]) const struct ipset_commands *command; const struct ipset_type *type; - /* Initialize session */ - if (session == NULL) { - session = ipset_session_init(printf); - if (session == NULL) - return exit_error(OTHER_PROBLEM, - "Cannot initialize ipset session, aborting."); - } - /* Set session lineno to report parser errors correctly */ ipset_session_lineno(session, restore_line); @@ -746,5 +738,11 @@ main(int argc, char *argv[]) ipset_type_add(&ipset_hash_ipportnet0); ipset_type_add(&ipset_list_set0); + /* Initialize session */ + session = ipset_session_init(printf); + if (session == NULL) + return exit_error(OTHER_PROBLEM, + "Cannot initialize ipset session, aborting."); + return parse_commandline(argc, argv); } |