From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net
Subject: [PATCH nft 2/2] netlink: fix listing of range set elements
Date: Mon, 8 Dec 2014 19:15:51 +0100 [thread overview]
Message-ID: <1418062551-4715-2-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1418062551-4715-1-git-send-email-pablo@netfilter.org>
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>
---
src/netlink.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/netlink.c b/src/netlink.c
index 23f38b0..e59e297 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) {
--
1.7.10.4
next prev parent reply other threads:[~2014-12-08 18:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-08 18:15 [PATCH nft 1/2] src: add big endian integer datatype Pablo Neira Ayuso
2014-12-08 18:15 ` Pablo Neira Ayuso [this message]
2014-12-08 18:31 ` Patrick McHardy
2014-12-08 18:41 ` Pablo Neira Ayuso
2014-12-08 18:50 ` Patrick McHardy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1418062551-4715-2-git-send-email-pablo@netfilter.org \
--to=pablo@netfilter.org \
--cc=kaber@trash.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).