From nobody Tue Dec 17 10:07:57 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YCCDZ2cvkz5h0dB; Tue, 17 Dec 2024 10:07:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCCDY6qsMz49vG; Tue, 17 Dec 2024 10:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T9jwEiL2lxhVlhF7/U78PCtIEL+6X9emXr+gBky6y70=; b=jtEleUkmsbw80gMv4C+o/0X9V9w/2qbsUP5t75XnqzwYISYVNjRT6cc400C+F8pfgCMipd QyHPuO9KKfmHVmes7m/d3BdDPcoViO5vEllShxipp4tUth/ROfVFOr8KcSTkQb2EAJ+F99 DOZCVRVNfHpYEEQOetTR5RDFLlKrinfhh5YBr1xQ0wAgpXUnPdbn8FZntHOwP0tG9DnGnB zNZWhjxjQxzAce49uXhDI9Fy1G9Xl/D7b7DzpAoZYfwaQ9iFG7kOJH/wjspkEk7TSIdTNK QwHaurQ8rUJwVbxynP0i3NMxQGAOHbiVRX7eytAfNMkk4wmAKn1huRPr5qD20w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430078; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=T9jwEiL2lxhVlhF7/U78PCtIEL+6X9emXr+gBky6y70=; b=Owvtl6x7CYJyU7O80x+Jo3QLcEgLS6IJBwxQGQTg3B7JyzRCCLO8FdIjmoON2P4jN9ldbY yQCXtw0YRFatL3ElNULYaR50VtiU2rUxOqfZNS2Q/OULdLu1bn7evK73iKEXmzTAYPDoBo RRhuQGP8Iqx9EG/D/xoc8CeOTEUAKbYKMzWLsnTD9lpOWTvfBfF5uP7zIAXJ3LhvSNg9gQ ecGVzuiCaGeKpCq96KnQIZftoyXpWkZyX1Yq04N2lwbBOQgBVP85JB1uXpKkuod2tKYEVb EKvHD1O0sH/uk1lZZkW2g0895jNnHZlS9onC7G71W+h3dXAhYY46jBYOR3u+GA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734430078; a=rsa-sha256; cv=none; b=Dy7cwqgLiFNy8i+Q7LY2fp6rJsTQXJ0D7acK7EMY03MHlcZbVeUrQll48Hq9t0jOc4edLX dM7Eu2mqvueOaF3A4Ua/FbfZkcKetEiQMtF7A3i4ozj7LKYsRO3+5h0Lrh3Kz3cuXK2HPO 5ADKaiqzYG8rYC7jq8okU7RbXT5HYqpAZ+5+k0pDp8VS7x4XOttZTq+OEkKik74TU+P00n HNQiR+J+T9Ds39Y/tAVTSEdla/jg9Ak9Z0msuv2vSSB0BzYeVz662PAXsJjKqpIuO+c2Ln tfxMf7A0s+vgNFLTbiRXHYNyItE9sG+WFYZsxsqFWNkCbt1qacVK8fx+p9MJVg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4YCCDY5WrDzJv1; Tue, 17 Dec 2024 10:07:57 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BHA7vq3024107; Tue, 17 Dec 2024 10:07:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BHA7vAJ024104; Tue, 17 Dec 2024 10:07:57 GMT (envelope-from git) Date: Tue, 17 Dec 2024 10:07:57 GMT Message-Id: <202412171007.4BHA7vAJ024104@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kristof Provost Subject: git: bc66cb3bfa9b - main - pf tests: verify that ICMP port unreachable makes it through NAT64 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bc66cb3bfa9be8a99805a3109c72420c22e72f3b Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=bc66cb3bfa9be8a99805a3109c72420c22e72f3b commit bc66cb3bfa9be8a99805a3109c72420c22e72f3b Author: Kristof Provost AuthorDate: 2024-11-08 16:34:56 +0000 Commit: Kristof Provost CommitDate: 2024-12-17 10:07:15 +0000 pf tests: verify that ICMP port unreachable makes it through NAT64 Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D47797 --- tests/sys/netpfil/pf/nat64.py | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/tests/sys/netpfil/pf/nat64.py b/tests/sys/netpfil/pf/nat64.py index 0053a2401872..a3bd6048028e 100644 --- a/tests/sys/netpfil/pf/nat64.py +++ b/tests/sys/netpfil/pf/nat64.py @@ -39,7 +39,7 @@ class TestNAT64(VnetTestTemplate): } 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 @@ class TestNAT64(VnetTestTemplate): 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