X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=main.c;h=71463aec6a3840b547291de8fbae5ece5f9939c3;hb=2807cc26b8e46eef5f23c06534a853dd48183331;hp=455c049cbb6a5678e286b4d605cd6c4cc810b9ef;hpb=91953d6a6e90df988f442f53097bd208784a295d;p=oweals%2Ffirewall3.git diff --git a/main.c b/main.c index 455c049..71463ae 100644 --- a/main.c +++ b/main.c @@ -167,8 +167,6 @@ family_set(struct fw3_state *state, enum fw3_family family, bool set) static int stop(bool complete) { - FILE *ct; - int rv = 1; enum fw3_family family; enum fw3_table table; @@ -224,13 +222,8 @@ stop(bool complete) if (run_state) fw3_destroy_ipsets(run_state); - if (complete && (ct = fopen("/proc/net/nf_conntrack", "w")) != NULL) - { - info(" * Flushing conntrack table ..."); - - fwrite("f\n", 2, 1, ct); - fclose(ct); - } + if (complete) + fw3_flush_conntrack(NULL); if (!rv && run_state) fw3_write_statefile(run_state); @@ -304,6 +297,7 @@ start(void) if (!rv) { + fw3_flush_conntrack(run_state); fw3_set_defaults(cfg_state); if (!print_family) @@ -395,6 +389,8 @@ start: if (!rv) { + fw3_flush_conntrack(run_state); + fw3_set_defaults(cfg_state); fw3_run_includes(cfg_state, true); fw3_hotplug_zones(cfg_state, true);