netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Subject: [PATCH libnftnl 3/3] expr: hash: missing trailing space and modulus in hexadecimal in snprintf
Date: Tue, 30 Aug 2016 12:41:09 +0200	[thread overview]
Message-ID: <1472553669-1910-3-git-send-email-pablo@netfilter.org> (raw)
In-Reply-To: <1472553669-1910-1-git-send-email-pablo@netfilter.org>

Before patch:

	[ hash reg 1 = jhash(reg 2, 8, 3735928559) % modulus 2]

After patch:

	[ hash reg 1 = jhash(reg 2, 8, 0xdeadbeef) % mod 2 ]

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/expr/hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/expr/hash.c b/src/expr/hash.c
index a3439d8..2d61508 100644
--- a/src/expr/hash.c
+++ b/src/expr/hash.c
@@ -235,7 +235,7 @@ nftnl_expr_hash_snprintf_default(char *buf, size_t size,
 	struct nftnl_expr_hash *hash = nftnl_expr_data(e);
 	int len = size, offset = 0, ret;
 
-	ret = snprintf(buf, len, "reg %u = jhash(reg %u, %u, %u) %% modulus %u",
+	ret = snprintf(buf, len, "reg %u = jhash(reg %u, %u, 0x%x) %% mod %u ",
 		       hash->dreg, hash->sreg, hash->len, hash->seed,
 		       hash->modulus);
 	SNPRINTF_BUFFER_SIZE(ret, size, len, offset);
-- 
2.1.4


      parent reply	other threads:[~2016-08-30 10:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-30 10:41 [PATCH libnftnl 1/3] expr: numgen: use switch to handle numgen types from snprintf Pablo Neira Ayuso
2016-08-30 10:41 ` [PATCH libnftnl 2/3] expr: numgen: add missing trailing whitespace Pablo Neira Ayuso
2016-08-30 10:41 ` Pablo Neira Ayuso [this message]

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=1472553669-1910-3-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --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).