diff options
author | Liping Zhang <zlpnobody@gmail.com> | 2017-04-15 17:22:17 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2017-04-15 11:30:08 +0200 |
commit | e2b25ccc31b8262a0739b46337fbb354e00aa1d6 (patch) | |
tree | 05db8f700716c22ef19ff6153807a173d17a8821 /include/hash.h | |
parent | cd3877cd4a7c4943dc29c274366795f02c42feb0 (diff) |
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 <zlpnobody@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/hash.h')
-rw-r--r-- | include/hash.h | 6 |
1 files changed, 4 insertions, 2 deletions
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 */ |