From: Pablo Neira Ayuso Date: Sun, 7 Dec 2014 23:25:13 +0000 (+0100) Subject: netlink: fix listing of range set elements in host byteorder X-Git-Tag: v0.4~15 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f874c2935bb790be378d7916ee426baa1a228603;p=thirdparty%2Fnftables.git 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 --- 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) {