Skip to contentSkip to conversation

datatype: display description for header field < 8 bits

PATCH Superseded Pablo Neira Ayuso 1 participant 1 message Oct 9, 2019 netfilter

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Pablo Neira Ayuso

author maintainer
#0 lore raw

PATCH 1/1 datatype: display description for header field < 8 bits

 # nft describe ip dscp
 payload expression, datatype dscp (Differentiated Services Code Point) (basetype integer), 6 bits

pre-defined symbolic constants (in hexadecimal):
nft: datatype.c:209: switch_byteorder: Assertion `len > 0' failed. Aborted

Fixes c89a0801d077 ("datatype: Display pre-defined inet_service values in host byte order")
---
 src/datatype.c | 3 +++
 1 file changed, 3 insertions(+)
src/datatype.c +3 -0
index 873f7d4d358b..0ee2925a8368 100644
@@ -220,6 +220,9 @@ void symbol_table_print(const struct symbol_table *tbl,
 	unsigned int len = dtype->size / BITS_PER_BYTE;
 	uint64_t value;
 
+	if (!len)
+		len = 1;
+
 	for (s = tbl->symbols; s->identifier != NULL; s++) {
 		value = s->value;
 
Signature · 1 line
2.11.0