netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH nft] src: hash: fix seed attribute not listed
@ 2017-03-24 20:03 Laura Garcia Liebana
  2017-03-24 20:25 ` Florian Westphal
  0 siblings, 1 reply; 3+ messages in thread
From: Laura Garcia Liebana @ 2017-03-24 20:03 UTC (permalink / raw)
  To: netfilter-devel

The tests warned about a problem with the seed listing.

/tests/py# ./nft-test.py ip/hash.t
ip/hash.t: WARNING: line: 4: 'src/nft add rule --debug=netlink \
 ip test-ip4 pre ct mark set jhash ip saddr . ip daddr mod 2 \
 seed 0xdeadbeef': 'ct mark set jhash ip saddr . ip daddr mod 2 \
 seed 0xdeadbeef' mismatches 'ct mark set jhash ip saddr . ip \
 daddr mod 2'
ip/hash.t: WARNING: line: 6: 'src/nft add rule --debug=netlink \
 ip test-ip4 pre ct mark set jhash ip saddr . ip daddr mod 2 seed \
 0xdeadbeef offset 100': 'ct mark set jhash ip saddr . ip daddr \
 mod 2 seed 0xdeadbeef offset 100' mismatches 'ct mark set jhash \
 ip saddr . ip daddr mod 2 offset 100'
ip/hash.t: 6 unit tests, 0 error, 2 warning

The expression type is now treated as an unsigned int in the
hash_expr_print() function.

Fixes 3a86406 ("src: hash: support of symmetric hash")

Signed-off-by: Laura Garcia Liebana <laura.garcia@zevenet.com>
---
 src/hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/hash.c b/src/hash.c
index a7a9612..bec1684 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -28,7 +28,7 @@ static void hash_expr_print(const struct expr *expr)
 	}
 
 	printf(" mod %u", expr->hash.mod);
-	if (expr->hash.type & NFT_HASH_JENKINS && expr->hash.seed)
+	if ((expr->hash.type == NFT_HASH_JENKINS) && expr->hash.seed)
 		printf(" seed 0x%x", expr->hash.seed);
 	if (expr->hash.offset)
 		printf(" offset %u", expr->hash.offset);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread
* [PATCH nft] src: hash: fix seed attribute not listed
@ 2017-03-24 19:53 Laura Garcia Liebana
  0 siblings, 0 replies; 3+ messages in thread
From: Laura Garcia Liebana @ 2017-03-24 19:53 UTC (permalink / raw)
  To: netfilter-devel

The tests warned about a problem with the seed listing.

/tests/py# ./nft-test.py ip/hash.t
ip/hash.t: WARNING: line: 4: 'src/nft add rule --debug=netlink \
 ip test-ip4 pre ct mark set jhash ip saddr . ip daddr mod 2 \
 seed 0xdeadbeef': 'ct mark set jhash ip saddr . ip daddr mod 2 \
 seed 0xdeadbeef' mismatches 'ct mark set jhash ip saddr . ip \
 daddr mod 2'
ip/hash.t: WARNING: line: 6: 'src/nft add rule --debug=netlink \
 ip test-ip4 pre ct mark set jhash ip saddr . ip daddr mod 2 seed \
 0xdeadbeef offset 100': 'ct mark set jhash ip saddr . ip daddr \
 mod 2 seed 0xdeadbeef offset 100' mismatches 'ct mark set jhash \
 ip saddr . ip daddr mod 2 offset 100'
ip/hash.t: 6 unit tests, 0 error, 2 warning

The expression type is now treated as an unsigned int in the
hash_expr_print() function.

Fixes 3a86406 ("src: hash: support of symmetric hash")

Signed-off-by: Laura Garcia Liebana <laura.garcia@zevenet.com>
---
 src/hash.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/hash.c b/src/hash.c
index a7a9612..bec1684 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -28,7 +28,7 @@ static void hash_expr_print(const struct expr *expr)
 	}
 
 	printf(" mod %u", expr->hash.mod);
-	if (expr->hash.type & NFT_HASH_JENKINS && expr->hash.seed)
+	if ((expr->hash.type == NFT_HASH_JENKINS) && expr->hash.seed)
 		printf(" seed 0x%x", expr->hash.seed);
 	if (expr->hash.offset)
 		printf(" offset %u", expr->hash.offset);
-- 
2.11.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-03-24 20:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-24 20:03 [PATCH nft] src: hash: fix seed attribute not listed Laura Garcia Liebana
2017-03-24 20:25 ` Florian Westphal
  -- strict thread matches above, loose matches on Subject: below --
2017-03-24 19:53 Laura Garcia Liebana

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).