From 285406b1d22e3ed0aec30ea0a534ea76211156a9 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 25 Jan 2024 02:12:24 +0100 Subject: extensions: *.t/*.txlate: Test range corner-cases For every extension option accepting a range, test open and half-open as well as single element and invalid (negative) ranges. The added tests merely reflect the status quo, not the expected outcome. Following patches will fix results and the already existing test cases highlight the fixes' effects. Signed-off-by: Phil Sutter --- extensions/libip6t_mh.txlate | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'extensions/libip6t_mh.txlate') diff --git a/extensions/libip6t_mh.txlate b/extensions/libip6t_mh.txlate index 4dfaf46a..825c9569 100644 --- a/extensions/libip6t_mh.txlate +++ b/extensions/libip6t_mh.txlate @@ -3,3 +3,12 @@ nft 'add rule ip6 filter INPUT meta l4proto mobility-header mh type 1 counter ac ip6tables-translate -A INPUT -p mh --mh-type 1:3 -j ACCEPT nft 'add rule ip6 filter INPUT meta l4proto mobility-header mh type 1-3 counter accept' + +ip6tables-translate -A INPUT -p mh --mh-type 0:255 -j ACCEPT +nft 'add rule ip6 filter INPUT meta l4proto mobility-header counter accept' + +ip6tables-translate -A INPUT -m mh --mh-type 0:255 -j ACCEPT +nft 'add rule ip6 filter INPUT counter accept' + +ip6tables-translate -A INPUT -p mh ! --mh-type 0:255 -j ACCEPT +nft 'add rule ip6 filter INPUT meta l4proto mobility-header counter accept' -- cgit v1.2.3