From: Jo-Philipp Wich Date: Sun, 10 Mar 2013 20:21:03 +0000 (+0100) Subject: Change fw3_no_family() macro to take bit field value directly X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=a4b710143626b399783865a3ea31bdb25aa1bac9;p=oweals%2Ffirewall3.git Change fw3_no_family() macro to take bit field value directly --- diff --git a/ipsets.c b/ipsets.c index 2c397b0..74706ff 100644 --- a/ipsets.c +++ b/ipsets.c @@ -379,10 +379,9 @@ fw3_destroy_ipsets(struct fw3_state *state, enum fw3_family family) list_for_each_entry_safe(s, tmp, &state->running_ipsets, running_list) { - if (hasbit(s->running_flags, family)) - delbit(s->flags, family); + delbit(s->running_flags, family); - if (fw3_no_family(s)) + if (fw3_no_family(s->running_flags)) { info(" * Deleting ipset %s", s->name); diff --git a/utils.c b/utils.c index 2747a85..ab1d68b 100644 --- a/utils.c +++ b/utils.c @@ -441,7 +441,7 @@ fw3_write_statefile(void *state) struct fw3_zone *z; struct fw3_ipset *i; - if (fw3_no_family(d)) + if (fw3_no_family(d->flags)) { if (unlink(FW3_STATEFILE)) warn("Unable to remove state %s: %s", diff --git a/utils.h b/utils.h index 79bf394..c3dc974 100644 --- a/utils.h +++ b/utils.h @@ -55,8 +55,8 @@ void info(const char *format, ...); #define fw3_is_family(p, f) \ (!p || (p)->family == FW3_FAMILY_ANY || (p)->family == f) -#define fw3_no_family(p) \ - (!p || !((p)->flags & ((1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6)))) +#define fw3_no_family(flags) \ + (!(flags & ((1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6)))) const char * fw3_find_command(const char *cmd); diff --git a/zones.c b/zones.c index ab656ef..4bf7df4 100644 --- a/zones.c +++ b/zones.c @@ -563,9 +563,9 @@ fw3_flush_zones(enum fw3_table table, enum fw3_family family, if (pass2) { - delbit(z->flags, family); + delbit(z->running_flags, family); - if (fw3_no_family(z)) + if (fw3_no_family(z->running_flags)) fw3_set_running(z, NULL); } }