]> git.baikalelectronics.ru Git - 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)
committerPablo Neira Ayuso <pablo@netfilter.org>
Tue, 16 Jul 2019 11:17:03 +0000 (13:17 +0200)
commit7398cea1d3cad1b6ed0cdbeb1165500119fe1659
tree6ee9c1f3988d66733dd8d9451748dee603d8a99e
parentd17fab8e85459b07700f1d1b4efc315c715c8ae2
netfilter: nft_hash: fix symhash with modulus one

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>
net/netfilter/nft_hash.c