Introduce fw3_no_family() helper macro and use it
[project/firewall3.git] / ipsets.c
index d6ff9bd..a987790 100644 (file)
--- a/ipsets.c
+++ b/ipsets.c
@@ -376,14 +376,13 @@ void
 fw3_destroy_ipsets(struct fw3_state *state, enum fw3_family family)
 {
        struct fw3_ipset *s, *tmp;
-       uint32_t family_mask = (1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6);
 
        list_for_each_entry_safe(s, tmp, &state->running_ipsets, running_list)
        {
                if (hasbit(s->running_flags, family))
                        delbit(s->flags, family);
 
-               if (!(s->flags & family_mask))
+               if (fw3_no_family(s))
                {
                        info("Deleting ipset %s", s->name);