summaryrefslogtreecommitdiffstats
path: root/tests/xlate
Commit message (Collapse)AuthorAgeFilesLines
* tests: xlate: Make test input validPhil Sutter2023-03-103-5/+15
| | | | | | | | | | | | | Make sure ipset at least accepts the test input by running it against plain ipset once for sanity. This exposed two issues: * Set 'hip5' doesn't have comment support, so add the commented elements to 'hip6' instead (likely a typo). * Set 'bip1' range 2.0.0.1-2.1.0.1 exceeds the max allowed for bitmap sets. Reduce it accordingly. Fixes: 7587d1c4b5465 ("tests: add tests ipset to nftables") Signed-off-by: Phil Sutter <phil@nwl.cc>
* tests: xlate: Test built binary by defaultPhil Sutter2023-03-102-6/+3
| | | | | | | | | Testing the host's iptables-translate by default is unintuitive. Since the ipset-translate symlink is created upon 'make install', add a local symlink to the repository pointing at a built binary in src/. Using this by default is consistent with the regular testsuite. Signed-off-by: Phil Sutter <phil@nwl.cc>
* Fix IPv6 sets nftables translationPablo Neira Ayuso2022-02-282-0/+4
| | | | | | | | | | | | | | | | | | The parser assumes the set is an IPv4 ipset because IPSET_OPT_FAMILY is not set. # ipset-translate restore < ./ipset-mwan3_set_connected_ipv6.dump add table inet global add set inet global mwan3_connected_v6 { type ipv6_addr; flags interval; } flush set inet global mwan3_connected_v6 ipset v7.15: Error in line 4: Syntax error: '64' is out of range 0-32 Remove ipset_xlate_type_get(), call ipset_xlate_set_get() instead to obtain the set type and family. Reported-by: Florian Eckert <fe@dev.tdt.de> Fixes: 325af556cd3a ("add ipset to nftables translation infrastructure") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
* tests: add tests ipset to nftablesPablo Neira Ayuso2021-06-263-0/+140
This test checks that the translation from ipset to nftables is correct. term$ cd tests/xlate term$ ./runtest.sh in case that the translation is not correct, it shows the diff with expected translation output. Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Jozsef Kadlecsik <kadlec@netfilter.org>