diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-12-08 00:25:13 +0100 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2014-12-09 19:12:20 +0100 |
commit | f874c2935bb790be378d7916ee426baa1a228603 (patch) | |
tree | 642770c727a01af5922c11712dffea5e28ba2bb5 | |
parent | 87ed152ebf561f20a2b5e23f2cf91e56a8d01838 (diff) |
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 <pablo@netfilter.org>
-rw-r--r-- | src/netlink.c | 4 |
1 files changed, 3 insertions, 1 deletions
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) { |