From f874c2935bb790be378d7916ee426baa1a228603 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Mon, 8 Dec 2014 00:25:13 +0100 Subject: netlink: fix listing of range set elements in host byteorder We have to switch the byteorder of the element in netlink_delinearize_setelem() for non-range values only. This fixes the listing of: nft add rule filter input ct mark { 0x10-0x20 } counter Signed-off-by: Pablo Neira Ayuso --- src/netlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/netlink.c') diff --git a/src/netlink.c b/src/netlink.c index 23f38b03..e59e2977 100644 --- a/src/netlink.c +++ b/src/netlink.c @@ -1379,7 +1379,9 @@ static int netlink_delinearize_setelem(struct nft_set_elem *nlse, expr = netlink_alloc_value(&netlink_location, &nld); expr->dtype = set->keytype; expr->byteorder = set->keytype->byteorder; - if (expr->byteorder == BYTEORDER_HOST_ENDIAN) + + if (!(set->flags & SET_F_INTERVAL) && + expr->byteorder == BYTEORDER_HOST_ENDIAN) mpz_switch_byteorder(expr->value, expr->len / BITS_PER_BYTE); if (flags & NFT_SET_ELEM_INTERVAL_END) { -- cgit v1.2.3