projects
/
project
/
firewall3.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Store ipset storage method and matches in state file, keep iprange and ports if set
[project/firewall3.git]
/
ipsets.c
diff --git
a/ipsets.c
b/ipsets.c
index
eb37d0a
..
713b343
100644
(file)
--- a/
ipsets.c
+++ b/
ipsets.c
@@
-91,15
+91,6
@@
check_types(struct uci_element *e, struct fw3_ipset *ipset)
uint32_t typelist = 0;
struct fw3_ipset_datatype *type;
uint32_t typelist = 0;
struct fw3_ipset_datatype *type;
- const char *methods[] = {
- "(bug)",
- "bitmap",
- "hash",
- "list",
- };
-
- typelist = 0;
-
list_for_each_entry(type, &ipset->datatypes, list)
{
if (i >= 3)
list_for_each_entry(type, &ipset->datatypes, list)
{
if (i >= 3)
@@
-121,7
+112,7
@@
check_types(struct uci_element *e, struct fw3_ipset *ipset)
ipset->method = ipset_types[i].method;
warn_elem(e, "defines no storage method, assuming '%s'",
ipset->method = ipset_types[i].method;
warn_elem(e, "defines no storage method, assuming '%s'",
-
method
s[ipset->method]);
+
fw3_ipset_method_name
s[ipset->method]);
break;
}
break;
}
@@
-277,33
+268,17
@@
create_ipset(struct fw3_ipset *ipset, struct fw3_state *state)
struct fw3_ipset_datatype *type;
struct fw3_ipset_datatype *type;
- const char *methods[] = {
- "(bug)",
- "bitmap",
- "hash",
- "list",
- };
-
- const char *types[] = {
- "(bug)",
- "ip",
- "port",
- "mac",
- "net",
- "set",
- };
-
if (ipset->external && *ipset->external)
return;
info(" * Creating ipset %s", ipset->name);
first = true;
if (ipset->external && *ipset->external)
return;
info(" * Creating ipset %s", ipset->name);
first = true;
- fw3_pr("create %s %s", ipset->name,
method
s[ipset->method]);
+ fw3_pr("create %s %s", ipset->name,
fw3_ipset_method_name
s[ipset->method]);
list_for_each_entry(type, &ipset->datatypes, list)
{
list_for_each_entry(type, &ipset->datatypes, list)
{
- fw3_pr("%c%s", first ? ':' : ',',
typ
es[type->type]);
+ fw3_pr("%c%s", first ? ':' : ',',
fw3_ipset_type_nam
es[type->type]);
first = false;
}
first = false;
}