summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/py/ip/masquerade.t4
-rw-r--r--tests/py/ip/masquerade.t.payload15
-rw-r--r--tests/py/ip6/masquerade.t4
-rw-r--r--tests/py/ip6/masquerade.t.payload.ip615
4 files changed, 38 insertions, 0 deletions
diff --git a/tests/py/ip/masquerade.t b/tests/py/ip/masquerade.t
index 0bb49a68..cee6e0e8 100644
--- a/tests/py/ip/masquerade.t
+++ b/tests/py/ip/masquerade.t
@@ -15,6 +15,10 @@ udp dport 53 masquerade persistent,random,fully-random;ok;udp dport 53 masquerad
udp dport 53 masquerade persistent,fully-random;ok;udp dport 53 masquerade fully-random,persistent
udp dport 53 masquerade persistent,fully-random,random;ok;udp dport 53 masquerade random,fully-random,persistent
+# using ports
+ip protocol 6 masquerade to :1024;ok
+ip protocol 6 masquerade to :1024-2048;ok
+
# masquerade is a terminal statement
tcp dport 22 masquerade counter packets 0 bytes 0 accept;fail
tcp sport 22 masquerade accept;fail
diff --git a/tests/py/ip/masquerade.t.payload b/tests/py/ip/masquerade.t.payload
index 9390f0cf..2479c8c9 100644
--- a/tests/py/ip/masquerade.t.payload
+++ b/tests/py/ip/masquerade.t.payload
@@ -125,3 +125,18 @@ ip test-ip4 postrouting
[ lookup reg 1 set map%d dreg 0 ]
[ masq ]
+# ip protocol 6 masquerade to :1024
+ip test-ip4 postrouting
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+ [ immediate reg 1 0x00000004 ]
+ [ masq proto_min reg 1 proto_max reg 0 ]
+
+# ip protocol 6 masquerade to :1024-2048
+ip test-ip4 postrouting
+ [ payload load 1b @ network header + 9 => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+ [ immediate reg 1 0x00000004 ]
+ [ immediate reg 2 0x00000008 ]
+ [ masq proto_min reg 1 proto_max reg 2 ]
+
diff --git a/tests/py/ip6/masquerade.t b/tests/py/ip6/masquerade.t
index 8040280e..d36ff76b 100644
--- a/tests/py/ip6/masquerade.t
+++ b/tests/py/ip6/masquerade.t
@@ -15,6 +15,10 @@ udp dport 53 masquerade persistent,random,fully-random;ok;udp dport 53 masquerad
udp dport 53 masquerade persistent,fully-random;ok;udp dport 53 masquerade fully-random,persistent
udp dport 53 masquerade persistent,fully-random,random;ok;udp dport 53 masquerade random,fully-random,persistent
+# using ports
+meta l4proto 6 masquerade to :1024;ok
+meta l4proto 6 masquerade to :1024-2048;ok
+
# masquerade is a terminal statement
tcp dport 22 masquerade counter packets 0 bytes 0 accept;fail
tcp sport 22 masquerade accept;fail
diff --git a/tests/py/ip6/masquerade.t.payload.ip6 b/tests/py/ip6/masquerade.t.payload.ip6
index 2e8bf959..778e709e 100644
--- a/tests/py/ip6/masquerade.t.payload.ip6
+++ b/tests/py/ip6/masquerade.t.payload.ip6
@@ -125,3 +125,18 @@ ip6 test-ip6 postrouting
[ lookup reg 1 set map%d dreg 0 ]
[ masq ]
+# meta l4proto 6 masquerade to :1024
+ip6 test-ip6 postrouting
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+ [ immediate reg 1 0x00000004 ]
+ [ masq proto_min reg 1 proto_max reg 0 ]
+
+# meta l4proto 6 masquerade to :1024-2048
+ip6 test-ip6 postrouting
+ [ meta load l4proto => reg 1 ]
+ [ cmp eq reg 1 0x00000006 ]
+ [ immediate reg 1 0x00000004 ]
+ [ immediate reg 2 0x00000008 ]
+ [ masq proto_min reg 1 proto_max reg 2 ]
+