summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-10-09 22:09:52 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-10-10 10:00:25 +0200
commit6450e36080e66e4edc90ea688ffb52c60e14f2cd (patch)
treec9d9a4b3616e5a93f3037b70c5b4209b02ca659b
parenta4ec053812610400b7a9e6c060d8b7589dedd5b1 (diff)
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") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--src/datatype.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/datatype.c b/src/datatype.c
index 873f7d4d..b9e167e0 100644
--- a/src/datatype.c
+++ b/src/datatype.c
@@ -216,8 +216,8 @@ void symbol_table_print(const struct symbol_table *tbl,
enum byteorder byteorder,
struct output_ctx *octx)
{
+ unsigned int len = div_round_up(dtype->size, BITS_PER_BYTE);
const struct symbolic_constant *s;
- unsigned int len = dtype->size / BITS_PER_BYTE;
uint64_t value;
for (s = tbl->symbols; s->identifier != NULL; s++) {