[PATCH libnftnl 3/3] expr: hash: missing trailing space and modulus in hexadecimal in snprintf

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux