X-Git-Url: http://git.archive.openwrt.org/?p=project%2Ffirewall3.git;a=blobdiff_plain;f=main.c;h=32ff87dbf1d42d2a54b02b2f3b26f18e23f595f2;hp=58975882308aee80da2da69d67a0d617c0cc5b3f;hb=d54cb962ebafdf2fde7256e234a2f3cfe8223c71;hpb=8e3a8634b002328b66a1d5aa3ba6e9f8231c029a diff --git a/main.c b/main.c index 5897588..32ff87d 100644 --- a/main.c +++ b/main.c @@ -205,6 +205,7 @@ stop(bool complete) } fw3_ipt_commit(handle); + fw3_ipt_close(handle); } family_set(run_state, family, false); @@ -280,6 +281,8 @@ start(void) if (!print_family) fw3_ipt_commit(handle); + + fw3_ipt_close(handle); } if (!print_family) @@ -339,6 +342,7 @@ reload(void) fw3_flush_rules(handle, run_state, true); fw3_flush_zones(handle, run_state, true); fw3_ipt_commit(handle); + fw3_ipt_close(handle); } family_set(run_state, family, false); @@ -369,6 +373,7 @@ start: fw3_print_default_tail_rules(handle, cfg_state, true); fw3_ipt_commit(handle); + fw3_ipt_close(handle); } fw3_print_includes(cfg_state, family, true); @@ -489,9 +494,18 @@ int main(int argc, char **argv) if (!strcmp(argv[optind], "print")) { if (family == FW3_FAMILY_ANY) + { family = FW3_FAMILY_V4; - else if (family == FW3_FAMILY_V6 && defs->disable_ipv6) - warn("IPv6 rules globally disabled in configuration"); + } + else if (family == FW3_FAMILY_V6) + { + if (defs->disable_ipv6) + warn("IPv6 rules globally disabled in configuration"); +#ifdef DISABLE_IPV6 + else + warn("IPv6 support is not compiled in"); +#endif + } freopen("/dev/null", "w", stderr);