Skip to content

Commit

Permalink
netfilter: nft_numgen: start round robin from zero
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Liping Zhang authored and Pablo Neira Ayuso committed Oct 26, 2016
1 parent 5efa0fc commit 0ecba4d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nft_numgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 0ecba4d

Please sign in to comment.