Re: [PATCH nft] hash: generate a random seed if seed option is empty

2017-04-13 Thread Liping Zhang
Hi Pablo, 2017-04-14 4:57 GMT+08:00 Pablo Neira Ayuso : [...] >> - nftnl_expr_set_u32(nle, NFTNL_EXPR_HASH_SEED, expr->hash.seed); >> + if (expr->hash.seed) >> + nftnl_expr_set_u32(nle, NFTNL_EXPR_HASH_SEED, expr->hash.seed); > > I prefer we have a hash.seed_set, instead of rel

Re: [PATCH nft] hash: generate a random seed if seed option is empty

2017-04-13 Thread Pablo Neira Ayuso
On Thu, Apr 13, 2017 at 10:57:09PM +0200, Pablo Neira Ayuso wrote: > On Mon, Apr 03, 2017 at 04:29:57PM +0800, Liping Zhang wrote: > > From: Liping Zhang > > > > 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 ze

Re: [PATCH nft] hash: generate a random seed if seed option is empty

2017-04-13 Thread Pablo Neira Ayuso
On Mon, Apr 03, 2017 at 04:29:57PM +0800, Liping Zhang wrote: > From: Liping Zhang > > 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 >

[PATCH nft] hash: generate a random seed if seed option is empty

2017-04-03 Thread Liping Zhang
From: Liping Zhang 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 generted in the kernel. Also: just to