summaryrefslogtreecommitdiffstats
path: root/lib/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/types.c')
-rw-r--r--lib/types.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/types.c b/lib/types.c
index 0fe8a7c..1adf640 100644
--- a/lib/types.c
+++ b/lib/types.c
@@ -497,12 +497,21 @@ int
ipset_type_add(struct ipset_type *type)
{
struct ipset_type *t, *prev;
+ const struct ipset_arg *arg;
+ enum ipset_adt cmd;
+ int i;
assert(type);
if (strlen(type->name) > IPSET_MAXNAMELEN - 1)
return -EINVAL;
+ for (cmd = IPSET_ADD; cmd < IPSET_CADT_MAX; cmd++) {
+ for (i = 0; type->cmd[cmd].args[i] != IPSET_ARG_NONE; i++) {
+ arg = ipset_keyword(type->cmd[cmd].args[i]);
+ type->cmd[cmd].full |= IPSET_FLAG(arg->opt);
+ }
+ }
/* Add to the list: higher revision numbers first */
for (t = typelist, prev = NULL; t != NULL; t = t->next) {
if (STREQ(t->name, type->name)) {