From 3f04c0149da0a43defd8b798a8837964d2d239c6 Mon Sep 17 00:00:00 2001 From: Mikael Magnusson Date: Sun, 26 Nov 2023 00:33:06 +0100 Subject: WIP: empty improvements --- filter/config.Y | 1 - filter/data.c | 4 +--- filter/data.h | 4 ++++ 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/filter/config.Y b/filter/config.Y index ee8ec096..4f857350 100644 --- a/filter/config.Y +++ b/filter/config.Y @@ -385,7 +385,6 @@ f_const_empty(enum f_type t) case T_CLIST: case T_ECLIST: case T_LCLIST: - case T_TLVLIST: return f_new_inst(FI_CONSTANT, (struct f_val) { .type = t, .val.ad = &null_adata, diff --git a/filter/data.c b/filter/data.c index 105f3848..d2347684 100644 --- a/filter/data.c +++ b/filter/data.c @@ -93,9 +93,7 @@ f_type_element_type(enum f_type t) const struct f_trie f_const_empty_trie = { .ipv4 = -1, }; const struct f_val f_const_empty_prefix_set = { .type = T_PREFIX_SET, - .val.ti = &f_const_empty_trie, -}, f_const_empty_tlvlist = { - .type = T_TLVLIST, + .val.ti = &f_const_empty_trie }; static struct adata * diff --git a/filter/data.h b/filter/data.h index 4abf4835..a6923eb6 100644 --- a/filter/data.h +++ b/filter/data.h @@ -352,8 +352,12 @@ val_empty(enum f_type t) case T_CLIST: case T_ECLIST: case T_LCLIST: + case T_EMPTY_LIST: return (struct f_val) { .type = t, .val.ad = &null_adata }; + case T_TLVLIST: + return (struct f_val) { .type = T_TLVLIST, .val.tl = NULL }; + default: return (struct f_val) { }; } -- cgit v1.2.3