]> 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)
commit28b1d6ef53e3303b90ca8924bb78f31fa527cafb
tree6ee9c1f3988d66733dd8d9451748dee603d8a99e
parentb717273ddb66a0c576d8c9884a6cfa70a5f49f6b
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