From da06a74244cbe4b02431ea2c34b8299f3562c9ff Mon Sep 17 00:00:00 2001 From: Florian Westphal Date: Thu, 14 Sep 2017 22:59:13 +0200 Subject: src: store expression as set key instead of data type Doing so retains legth information in case of unqualified data types, e.g. we now have 'meta iifname' expression instead of an (unqualified) string type. This allows to eventually use iifnames as set keys without adding yet another special data type for them. Signed-off-by: Florian Westphal Acked-by: Pablo Neira Ayuso --- src/rule.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/rule.c') diff --git a/src/rule.c b/src/rule.c index 8f0e752f..1e0558ea 100644 --- a/src/rule.c +++ b/src/rule.c @@ -215,7 +215,7 @@ void set_free(struct set *set) if (set->init != NULL) expr_free(set->init); handle_free(&set->handle); - set_datatype_destroy(set->keytype); + expr_free(set->key); set_datatype_destroy(set->datatype); xfree(set); } @@ -296,7 +296,7 @@ static void set_print_declaration(const struct set *set, printf(" %s {%s", set->handle.set, opts->nl); - printf("%s%stype %s", opts->tab, opts->tab, set->keytype->name); + printf("%s%stype %s", opts->tab, opts->tab, set->key->dtype->name); if (set->flags & NFT_SET_MAP) printf(" : %s", set->datatype->name); else if (set->flags & NFT_SET_OBJECT) -- cgit v1.2.3