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
a720172
..
a987790
100644
(file)
--- a/
ipsets.c
+++ b/
ipsets.c
@@
-20,6
+20,8
@@
const struct fw3_option fw3_ipset_opts[] = {
const struct fw3_option fw3_ipset_opts[] = {
+ FW3_OPT("enabled", bool, ipset, enabled),
+
FW3_OPT("name", string, ipset, name),
FW3_OPT("family", family, ipset, family),
FW3_OPT("name", string, ipset, name),
FW3_OPT("family", family, ipset, family),
@@
-371,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(state->defaults.flags, FW3_FAMILY_V6))
- delbit(s->flags, FW3_FAMILY_V6);
+ if (hasbit(s->running_flags, family))
+ delbit(s->flags, family);
- if (
!(s->flags & mask
))
+ if (
fw3_no_family(s
))
{
info("Deleting ipset %s", s->name);
{
info("Deleting ipset %s", s->name);