From nobody Tue Dec 17 10:08:10 2024 X-Original-To: dev-commits-src-all@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 4YCCDp6HK4z5h0rV; Tue, 17 Dec 2024 10:08:10 +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 4YCCDp3lgWz4Bhw; Tue, 17 Dec 2024 10:08:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430090; 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=sIkAyd/4rCLO3hTlbdxdySY+EKZ+3AjD024PFlrsn3Q=; b=loTUsd9R1ysYqyPUaV86h1Z/M7A1u/jOXusXXW44aqrUvee2cAWufVIGjDgpzn4COc3ky1 X2Irq6FrL+1ro4GMJprIoVwXMaJcsD0Q6eb/J/S9w4DULPYdJ7ULy1j59S5JHZp7J70kAX 9WD78vv6PXqQztK1buVZR1KHypBT5JUX/qQuj3C9arm8nGiBGwrhVQ9pO8+Qm/dqVQ3+By hlYAbvJpwhCsQN62vtEhWJFyfO2a07eFm5MChnLOTldD2jhDsxohvY0zvAct2mGg0OBFhE SVN6E6jt3psUnp2cGWy8goKBg9O0vAYYzjq98gVTuCaSwRyxY6xeszkcyusBOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1734430090; 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=sIkAyd/4rCLO3hTlbdxdySY+EKZ+3AjD024PFlrsn3Q=; b=NP82K3t9Tv9tOTxrJ33lLr2UeJFBAYRF9ZRLoxB3hmOFWBBJmvjIwrf4vpJSWQJj5vgUrH kVKq7MvVUZ8f1eUOtkr0KvIdREzOSSnYh/nTQoh9cpLCxbqa9WKhz/tgTMXqIoNgH2FgNM vsOFKzxpoZq15DEULlwWX2vVWNAjBKx+tUd01VGCWLh9WP2//mOduYJYEstizaxAZEWEBm N8TjhC5Q0c37obAbwa3UNAKGwZGf+AIlJofwkhjiDVFH0fhCGR68r+MhFR8KtuNon0CGdv Yp9tO++COXB0msZPzIkfBstaV03WD6WTfhXkNksw47dtT9ZtJVptyKb3JhS+Dw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1734430090; a=rsa-sha256; cv=none; b=xbz1/PaG2BvsQWWgjZwqJ+R4A4orymsW1umlfNx+sS9KpcNmSJASa5CP5zNN+2pjrt9S+Z 0B8Ra+IhwfOCuQmDPF92MRcKuN+m9NcGvEs4okePiSkkZC88u22pccLU9G18S5Joywx3BW hZoJWNQbJ8utyKmevWkcf3C2L5EDNSnZ/h3bNI/Iw7tH+ILxJ8vFiF0TWjcRddZrM7bvv6 8IxBUfpZy2tUBy0UAY3IfF8jQoZjAl4Kyaj8TG/nGU9FQXGH12+/NDTLXaqsUO/bb8Wsy0 4plP/1NA0ORaoM5yt9A14lStkS8pV4b2n9I84q0dcNcGY1e1iTEC5ZsCRZuWIg== 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 4YCCDp2274zJvj; Tue, 17 Dec 2024 10:08:10 +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 4BHA8AQF024724; Tue, 17 Dec 2024 10:08:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BHA8AN2024721; Tue, 17 Dec 2024 10:08:10 GMT (envelope-from git) Date: Tue, 17 Dec 2024 10:08:10 GMT Message-Id: <202412171008.4BHA8AN2024721@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: 125e395278cf - main - pf tests: test not having an IPv4 address to nat64 to List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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: 125e395278cf01811a06bb7fdb2dce6854eafc3c Auto-Submitted: auto-generated The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=125e395278cf01811a06bb7fdb2dce6854eafc3c commit 125e395278cf01811a06bb7fdb2dce6854eafc3c Author: Kristof Provost AuthorDate: 2024-12-05 17:23:29 +0000 Commit: Kristof Provost CommitDate: 2024-12-17 10:07:17 +0000 pf tests: test not having an IPv4 address to nat64 to This isn't expected to work, for obvious reasons, but we also expect to not panic doing this. Exercise this special case. Sponsored by: Rubicon Communications, LLC ("Netgate") --- tests/sys/netpfil/pf/nat64.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/tests/sys/netpfil/pf/nat64.sh b/tests/sys/netpfil/pf/nat64.sh index c1202dfee2e8..809d058d34c9 100644 --- a/tests/sys/netpfil/pf/nat64.sh +++ b/tests/sys/netpfil/pf/nat64.sh @@ -235,6 +235,46 @@ tos_cleanup() pft_cleanup } +atf_test_case "no_v4" "cleanup" +no_v4_head() +{ + atf_set descr 'Test error handling when there is no IPv4 address to translate to' + atf_set require.user root +} + +no_v4_body() +{ + pft_init + + epair_link=$(vnet_mkepair) + epair=$(vnet_mkepair) + + ifconfig ${epair}a inet6 2001:db8::2/64 up no_dad + route -6 add default 2001:db8::1 + + vnet_mkjail rtr ${epair}b ${epair_link}a + jexec rtr ifconfig ${epair}b inet6 2001:db8::1/64 up no_dad + + vnet_mkjail dst ${epair_link}b + jexec dst ifconfig ${epair_link}b 192.0.2.2/24 up + jexec dst route add default 192.0.2.1 + + # Sanity check + atf_check -s exit:0 -o ignore \ + ping6 -c 1 2001:db8::1 + + jexec rtr pfctl -e + pft_set_rules rtr \ + "pass in on ${epair}b inet6 from any to 64:ff9b::/96 af-to inet from (${epair_link}a)" + + atf_check -s exit:2 -o ignore \ + ping6 -c 3 64:ff9b::192.0.2.2 +} + +no_v4_cleanup() +{ + pft_cleanup +} atf_init_test_cases() { atf_add_test_case "icmp_echo" @@ -243,4 +283,5 @@ atf_init_test_cases() atf_add_test_case "udp" atf_add_test_case "sctp" atf_add_test_case "tos" + atf_add_test_case "no_v4" }