Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115654751
D47797.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47797.diff
View Options
diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py
--- a/tests/sys/netpfil/pf/nat64.py
+++ b/tests/sys/netpfil/pf/nat64.py
@@ -39,7 +39,7 @@
}
def vnet3_handler(self, vnet):
- ToolsHelper.print_output("echo foo | nc -l 1234")
+ ToolsHelper.print_output("echo foo | nc -l 1234 &")
def vnet2_handler(self, vnet):
ifname = vnet.iface_alias_map["if1"].name
@@ -82,3 +82,23 @@
assert "S" in tcp.flags
assert "A" in tcp.flags
+ @pytest.mark.require_user("root")
+ def test_udp_port_closed(self):
+ ToolsHelper.print_output("/sbin/route -6 add default 2001:db8::1")
+
+ import scapy.all as sp
+
+ packet = sp.IPv6(dst="64:ff9b::192.0.2.2") \
+ / sp.UDP(dport=1222) / sp.Raw("bar")
+ reply = sp.sr1(packet, timeout=3)
+ print(reply.show())
+
+ # We expect an ICMPv6 error, not a UDP reply
+ assert not reply.getlayer(sp.UDP)
+ icmp = reply.getlayer(sp.ICMPv6DestUnreach)
+ assert icmp
+ assert icmp.type == 1
+ assert icmp.code == 4
+ udp = reply.getlayer(sp.UDPerror)
+ assert udp
+ assert udp.dport == 1222
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 27, 3:25 PM (14 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17819326
Default Alt Text
D47797.diff (1 KB)
Attached To
Mode
D47797: pf tests: verify that ICMP port unreachable makes it through NAT64
Attached
Detach File
Event Timeline
Log In to Comment