projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
selectively delete chains in filter and nat tables
[project/firewall3.git]
/
ipsets.c
diff --git
a/ipsets.c
b/ipsets.c
index
ca0bd29
..
215be73
100644
(file)
--- a/
ipsets.c
+++ b/
ipsets.c
@@
-351,39
+351,22
@@
fw3_create_ipsets(struct fw3_state *state)
}
void
}
void
-fw3_destroy_ipsets(struct
fw3_state *stat
e)
+fw3_destroy_ipsets(struct
list_head *statefil
e)
{
{
- FILE *sf;
-
- char *p;
- char line[128];
-
- sf = fopen(FW3_STATEFILE, "r");
-
- if (!sf)
- return;
+ struct fw3_statefile_entry *e;
info("Destroying ipsets ...");
info("Destroying ipsets ...");
-
while (fgets(line, sizeof(line), sf)
)
+
list_for_each_entry(e, statefile, list
)
{
{
- if (strncmp(line, "ipset ", 6))
- continue;
-
- p = strtok(line+6, " \t\n");
-
- if (!p || !strlen(p))
+ if (e->type != FW3_TYPE_IPSET)
continue;
continue;
- info(" * %s",
p
);
+ info(" * %s",
e->name
);
- fw3_pr("flush %s\n",
p
);
- fw3_pr("destroy %s\n",
p
);
+ fw3_pr("flush %s\n",
e->name
);
+ fw3_pr("destroy %s\n",
e->name
);
}
}
-
- fw3_pr("quit\n");
-
- fclose(sf);
}
void
}
void