]> git.ipfire.org Git - people/arne_f/kernel.git/commit
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:13:51 +0000 (10:13 +0200)
commit628272f3f3f20b40e608e1e72739fae9efb62bc8
tree58c1200bfaf6c1cc4e2172d0f79f2db875ee595e
parent4557544969d5686ed9e48527e6b4c16fef622e26
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