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);
struct fw3_zone *z;
struct fw3_ipset *i;
- int mask = (1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6);
-
- if (!(d->flags & mask))
+ if (fw3_no_family(d))
{
if (unlink(FW3_STATEFILE))
warn("Unable to remove state %s: %s",
#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))))
+
const char * fw3_find_command(const char *cmd);
bool fw3_stdout_pipe(void);
{
struct fw3_zone *z, *tmp;
uint32_t custom_mask = ~0;
- uint32_t family_mask = (1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6);
/* don't touch user chains on selective stop */
if (reload)
{
delbit(z->flags, family);
- if (!(z->flags & family_mask))
+ if (fw3_no_family(z))
fw3_set_running(z, NULL);
}
}