From e2b25ccc31b8262a0739b46337fbb354e00aa1d6 Mon Sep 17 00:00:00 2001 From: Liping Zhang Date: Sat, 15 Apr 2017 17:22:17 +0800 Subject: hash: generate a random seed if seed option is empty Typing the "nft add rule x y ct mark set jhash ip saddr mod 2" will not generate a random seed, instead, the seed will always be zero. So if seed option is empty, we shoulde not set the NFTA_HASH_SEED attribute, then a random seed will be generated in the kernel. Signed-off-by: Liping Zhang Signed-off-by: Pablo Neira Ayuso --- include/hash.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include/hash.h') diff --git a/include/hash.h b/include/hash.h index 7f9c6f13..693d08a2 100644 --- a/include/hash.h +++ b/include/hash.h @@ -2,7 +2,9 @@ #define NFTABLES_HASH_H extern struct expr *hash_expr_alloc(const struct location *loc, - uint32_t modulus, uint32_t seed, - uint32_t offset, enum nft_hash_types type); + uint32_t modulus, + bool seed_set, uint32_t seed, + uint32_t offset, + enum nft_hash_types type); #endif /* NFTABLES_HASH_H */ -- cgit v1.2.3