@@ -27,6 +27,7 @@ union nftnl_data_reg {
const char *chain;
uint32_t chain_id;
};
+ bool incomplete;
};
int nftnl_data_reg_snprintf(char *buf, size_t size,
@@ -34,6 +34,7 @@ struct nftnl_set {
uint32_t gc_interval;
uint64_t timeout;
struct list_head expr_list;
+ bool incomplete;
};
struct nftnl_set_list;
@@ -135,6 +135,9 @@ nftnl_parse_verdict(union nftnl_data_reg *data, const struct nlattr *attr, int *
if (!tb[NFTA_VERDICT_CODE])
return -1;
+ if (tb[NFTA_VERDICT_UNSPEC])
+ data->incomplete = true;
+
data->verdict = ntohl(mnl_attr_get_u32(tb[NFTA_VERDICT_CODE]));
switch(data->verdict) {
@@ -193,6 +196,9 @@ int nftnl_parse_data(union nftnl_data_reg *data, struct nlattr *attr, int *type)
if (mnl_attr_parse_nested(attr, nftnl_data_parse_cb, tb) < 0)
return -1;
+ if (tb[NFTA_DATA_UNSPEC])
+ data->incomplete = true;
+
if (tb[NFTA_DATA_VALUE]) {
if (type)
*type = DATA_VALUE;
@@ -589,6 +589,11 @@ static int nftnl_set_elems_parse2(struct nftnl_set *s, const struct nlattr *nest
e->flags |= (1 << NFTNL_SET_ELEM_OBJREF);
}
+ if (!s->incomplete)
+ s->incomplete = e->key.incomplete ||
+ e->key_end.incomplete ||
+ e->data.incomplete;
+
/* Add this new element to this set */
list_add_tail(&e->head, &s->element_list);
Like previous patch: Extend data and set representation to indicate an incomplete dissection. Signed-off-by: Florian Westphal <fw@strlen.de> --- include/data_reg.h | 1 + include/set.h | 1 + src/expr/data_reg.c | 6 ++++++ src/set_elem.c | 5 +++++ 4 files changed, 13 insertions(+)