summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPhil Sutter <phil@nwl.cc>2020-12-26 19:44:48 +0100
committerPhil Sutter <phil@nwl.cc>2021-03-09 16:24:46 +0100
commit228e8b1746270ee5c4a41b671a01369c75622587 (patch)
tree6912052d62bb6d3fb88f342ba007465fce837bce /include
parent5048736e76e553b54b445dee488a6316468bce73 (diff)
set_elem: Fix printing of verdict map elements
Elements' data was printed as type DATA_VALUE no matter the actual type. For verdicts, this meant no printing at all (because reg->len is either zero or garbage). To fix this, nftnl_set_elem_snprintf_default() needs type info held in struct nftnl_set. Pass it via parameter to that function, make it non-static and call it from nftnl_set_snprintf_default() instead of the generic nftnl_set_elem_snprintf(). This way no changes have to be done to exported functions, also the output type is already defined when nftnl_set_snprintf_default() runs so checking type value again is pointless. Signed-off-by: Phil Sutter <phil@nwl.cc>
Diffstat (limited to 'include')
-rw-r--r--include/set_elem.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/set_elem.h b/include/set_elem.h
index 9239557..503dced 100644
--- a/include/set_elem.h
+++ b/include/set_elem.h
@@ -20,4 +20,8 @@ struct nftnl_set_elem {
} user;
};
+int nftnl_set_elem_snprintf_default(char *buf, size_t size,
+ const struct nftnl_set_elem *e,
+ enum nft_data_types dtype);
+
#endif