X-Git-Url: https://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=main.c;h=79d3b0b37acc7b2b33e4ff4ecf1373e5d9807a21;hp=1135c50c758e045d904de073bc86041866934141;hb=c79bb766d587799bbe012defc00ed70644ceb7f5;hpb=5f0b781b249bba29e23ba797b347d0904f90f726 diff --git a/main.c b/main.c index 1135c50..79d3b0b 100644 --- a/main.c +++ b/main.c @@ -162,6 +162,8 @@ family_set(struct fw3_state *state, enum fw3_family family, bool set) static int stop(struct fw3_state *state, bool complete, bool reload) { + FILE *ct; + int rv = 1; enum fw3_family family; enum fw3_table table; @@ -228,6 +230,14 @@ stop(struct fw3_state *state, bool complete, bool reload) fw3_command_close(); } + if (complete && (ct = fopen("/proc/net/nf_conntrack", "w")) != NULL) + { + info("Flushing conntrack table ..."); + + fwrite("f\n", 2, 1, ct); + fclose(ct); + } + if (!rv) fw3_write_statefile(state);