projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Introduce fw3_no_family() helper macro and use it
[project/firewall3.git]
/
ipsets.c
diff --git
a/ipsets.c
b/ipsets.c
index
62877c8
..
a987790
100644
(file)
--- a/
ipsets.c
+++ b/
ipsets.c
@@
-373,20
+373,16
@@
fw3_create_ipsets(struct fw3_state *state)
}
void
}
void
-fw3_destroy_ipsets(struct fw3_state *state)
+fw3_destroy_ipsets(struct fw3_state *state
, enum fw3_family family
)
{
struct fw3_ipset *s, *tmp;
{
struct fw3_ipset *s, *tmp;
- int mask = (1 << FW3_FAMILY_V4) | (1 << FW3_FAMILY_V6);
list_for_each_entry_safe(s, tmp, &state->running_ipsets, running_list)
{
list_for_each_entry_safe(s, tmp, &state->running_ipsets, running_list)
{
- if (
!hasbit(state->defaults.flags, FW3_FAMILY_V4
))
- delbit(s->flags,
FW3_FAMILY_V4
);
+ if (
hasbit(s->running_flags, family
))
+ delbit(s->flags,
family
);
- if (!hasbit(state->defaults.flags, FW3_FAMILY_V6))
- delbit(s->flags, FW3_FAMILY_V6);
-
- if (!(s->flags & mask))
+ if (fw3_no_family(s))
{
info("Deleting ipset %s", s->name);
{
info("Deleting ipset %s", s->name);