Fix rules for custom filter chains
[project/firewall3.git] / main.c
diff --git a/main.c b/main.c
index fd6140a..8305f9f 100644 (file)
--- a/main.c
+++ b/main.c
@@ -214,13 +214,7 @@ stop(bool complete)
        }
 
        if (run_state)
-       {
-               if (fw3_command_pipe(false, "ipset", "-exist", "-"))
-               {
-                       fw3_destroy_ipsets(run_state);
-                       fw3_command_close();
-               }
-       }
+               fw3_destroy_ipsets(run_state);
 
        if (complete && (ct = fopen("/proc/net/nf_conntrack", "w")) != NULL)
        {
@@ -245,13 +239,7 @@ start(void)
        struct fw3_ipt_handle *handle;
 
        if (!print_family)
-       {
-               if (fw3_command_pipe(false, "ipset", "-exist", "-"))
-               {
-                       fw3_create_ipsets(cfg_state);
-                       fw3_command_close();
-               }
-       }
+               fw3_create_ipsets(cfg_state);
 
        for (family = FW3_FAMILY_V4; family <= FW3_FAMILY_V6; family++)
        {
@@ -294,7 +282,8 @@ start(void)
                                fw3_ipt_commit(handle);
                }
 
-               //fw3_print_includes(cfg_state, family, false);
+               if (!print_family)
+                       fw3_print_includes(cfg_state, family, false);
 
                family_set(run_state, family, true);
                family_set(cfg_state, family, true);
@@ -384,7 +373,7 @@ start:
                        fw3_ipt_commit(handle);
                }
 
-               //fw3_print_includes(cfg_state, family, true);
+               fw3_print_includes(cfg_state, family, true);
 
                family_set(run_state, family, true);
                family_set(cfg_state, family, true);