OSDN Git Service

netfilter: nft_hash: fix symhash with modulus one
authorLaura Garcia Liebana <nevola@gmail.com>
Mon, 15 Jul 2019 11:23:37 +0000 (13:23 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Aug 2019 08:12:44 +0000 (10:12 +0200)
commit36b6458d8541d47a55b6aa20ac1792edf270410c
tree591345e09df8811050be113badc92dfa918b5fc3
parent6f1d7f0d66899646ac50e717ca4cffd9c6c794ba
netfilter: nft_hash: fix symhash with modulus one

[ Upstream commit 28b1d6ef53e3303b90ca8924bb78f31fa527cafb ]

The rule below doesn't work as the kernel raises -ERANGE.

nft add rule netdev nftlb lb01 ip daddr set \
symhash mod 1 map { 0 : 192.168.0.10 } fwd to "eth0"

This patch allows to use the symhash modulus with one
element, in the same way that the other types of hashes and
algorithms that uses the modulus parameter.

Signed-off-by: Laura Garcia Liebana <nevola@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/netfilter/nft_hash.c