diff options
author | Liping Zhang <liping.zhang@spreadtrum.com> | 2016-10-19 23:29:53 +0800 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2016-10-26 16:35:16 +0200 |
commit | 0ecba4d9d1db51f670af7ba9049461116a3a2bea (patch) | |
tree | 6125b51fffbe17c406e39312396f51cef6982b7d /net/netfilter/nft_numgen.c | |
parent | 5efa0fc6d7f7930b18801f07cefae8eeacd6ac02 (diff) |
netfilter: nft_numgen: start round robin from zero
Currently we start round robin from 1, but it's better to start round
robin from 0. This is to keep consistent with xt_statistic in iptables.
Signed-off-by: Liping Zhang <liping.zhang@spreadtrum.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nft_numgen.c')
-rw-r--r-- | net/netfilter/nft_numgen.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nft_numgen.c b/net/netfilter/nft_numgen.c index 55bc5ab78d4a..a66b36097b8f 100644 --- a/net/netfilter/nft_numgen.c +++ b/net/netfilter/nft_numgen.c @@ -65,7 +65,7 @@ static int nft_ng_inc_init(const struct nft_ctx *ctx, return -EOVERFLOW; priv->dreg = nft_parse_register(tb[NFTA_NG_DREG]); - atomic_set(&priv->counter, 0); + atomic_set(&priv->counter, priv->modulus - 1); return nft_validate_register_store(ctx, priv->dreg, NULL, NFT_DATA_VALUE, sizeof(u32)); |