]> git.ipfire.org Git - thirdparty/libnftnl.git/commit
set_elem: Fix printing of verdict map elements
authorPhil Sutter <phil@nwl.cc>
Sat, 26 Dec 2020 18:44:48 +0000 (19:44 +0100)
committerPhil Sutter <phil@nwl.cc>
Tue, 9 Mar 2021 15:24:46 +0000 (16:24 +0100)
commit228e8b1746270ee5c4a41b671a01369c75622587
tree6912052d62bb6d3fb88f342ba007465fce837bce
parent5048736e76e553b54b445dee488a6316468bce73
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>
include/set_elem.h
src/set.c
src/set_elem.c