From nobody Sat Feb 22 19:28:28 2025 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 4Z0cVN4yXtz5pG0M; Sat, 22 Feb 2025 19:28:28 +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 4Z0cVN45Ffz3lnh; Sat, 22 Feb 2025 19:28:28 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740252508; 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=NOkihmPriNEvL5RpbwKEbHhSvJ2xpJQaOBVVyI2wuNE=; b=S0t8Am1L9GPkPmlRgb2uMqpi3GvPmr2c7ZSHaEFADApCx6GmSmdP4owpczvgwhbPNFSi9U doGPtBKdzMZx9PEdu6Q7fHj5yar/lbjP+LpBZO/iSfuHvWKLiXCFh2c8o8+JIJjzHRDLGu uzc3B/CmOfN677sDA6IeOHzxPjMU72iSmDmEsKvNzGDpyQ9+XWilQRVfMSE4Q9RzDW7buB TO40SyHJSO9JlKsBaQ8GEm4ko8PoS1eqHVNcz8tGcDCp7FrH8Q8SNgKK1Uq9bYj9/FWCaC jd8+40dZxBmkLbxm6UZ4fuBpBVbdZIGBLHikJkAzZQlZtxDII8SofYdAcWysUA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740252508; a=rsa-sha256; cv=none; b=Xd8u6VtQGpS9UZy1ivNi9ZSVJqKmZAEO21ZG6Q4nVgGBarzqKfp18HZhOMN3k5euxYnrod Ajn4C8oNnJWw2C0zsvEgoReU7DhEv3llFoBDfegDXvnKJubaPM9ThoWmXDxtLtFXz4P5PU ekSNxou/qgXK1cB9yAb0bBopDLP2HDO4NSsHOBQ1W77gXXWB7XCEF8ZO3eN6mO6XU16x60 7fqWa3ndC8QCyPSyYFfN/v321V2t1E/da+wzm86P6fkAAythbGtBocML5q8Fd8aFzTI2H0 tLbD33XJxAEglsrpmhBYHSOHwsL9Nd3ZobvdA+hdhm1JoaaTu2rLSjtI37iGgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740252508; 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=NOkihmPriNEvL5RpbwKEbHhSvJ2xpJQaOBVVyI2wuNE=; b=Lul/KfAE5HTyQ/qo7yrsWosydo90r7Q/8Xb3V2ECSJ8/rLT6lT8f4PmP7vSpcWVVGUqVjV TP65Rc2DNsgbuWMjpm6ujEgocKwBuTj5ZPg3Y28Bslk3m91L0tAPq2je/LsZvfHAUyMn5j pqtRgfIzcTvyA+44we3rSTHnKOd6AWiTnqcKvk8TpGPR+RkeIaU6wIZASt5vZb+aFjsddg aKrnmWXkrL/xY96Zv5yMykySyxgMg1I+774sbTTdoR4koV/36iiHyUswAS93kLqj1gG20Q UuE572XIcptx7Qo8fm9wbJbMnGdRMHpSyJZMvOQt6K3TxHJ+7auvJiy8+uTxRw== 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 4Z0cVN3YrQz6Cr; Sat, 22 Feb 2025 19:28:28 +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 51MJSSF5035396; Sat, 22 Feb 2025 19:28:28 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51MJSSjA035393; Sat, 22 Feb 2025 19:28:28 GMT (envelope-from git) Date: Sat, 22 Feb 2025 19:28:28 GMT Message-Id: <202502221928.51MJSSjA035393@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: 93fbdef51a13 - main - tests: carp: Update test case unicast_v4 to catch PR 284872 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 93fbdef51a13b8facac3633f55804a59ca27f635 Auto-Submitted: auto-generated The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=93fbdef51a13b8facac3633f55804a59ca27f635 commit 93fbdef51a13b8facac3633f55804a59ca27f635 Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:32 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-22 19:26:32 +0000 tests: carp: Update test case unicast_v4 to catch PR 284872 In the current test case unicast_v4, host one acts as a router, but it uses if_bridge(4) to verify the reachability to CARP master. Unfortunately, if_bridge(4) brings the two CARP hosts into the same broadcast domain, thus with an unusual (undocumented) setup, one host is in unicast mode but another one in multicast, or two hosts are both in multicast mode, the test case can falsely report success. Fix that by propagating route via routed(8). PR 284872 shows that CARP(4) happens to send packets with multicast destination when the unicast peer address is in the range x.x.x.224 ~ x.x.x.239. Update the peer address in test case to catch that bug. PR: 284872 Reviewed by: kp MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D49076 --- tests/sys/netinet/carp.sh | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/tests/sys/netinet/carp.sh b/tests/sys/netinet/carp.sh index f9e47c70f492..2aae2854826e 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -163,49 +163,53 @@ unicast_v4_head() unicast_v4_body() { carp_init - vnet_init_bridge - bridge=$(vnet_mkbridge) epair_one=$(vnet_mkepair) epair_two=$(vnet_mkepair) - vnet_mkjail carp_uni_v4_one ${bridge} ${epair_one}a ${epair_two}a + vnet_mkjail carp_uni_v4_one ${epair_one}a ${epair_two}a vnet_mkjail carp_uni_v4_two ${epair_one}b vnet_mkjail carp_uni_v4_three ${epair_two}b - jexec carp_uni_v4_one ifconfig ${bridge} 192.0.2.4/29 up jexec carp_uni_v4_one sysctl net.inet.ip.forwarding=1 - jexec carp_uni_v4_one ifconfig ${bridge} addm ${epair_one}a \ - addm ${epair_two}a - jexec carp_uni_v4_one ifconfig ${epair_one}a up - jexec carp_uni_v4_one ifconfig ${epair_two}a up - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.1/25 - jexec carp_uni_v4_one ifconfig ${bridge} inet alias 198.51.100.129/25 + jexec carp_uni_v4_one ifconfig ${epair_one}a inet 198.51.100.1/25 + jexec carp_uni_v4_one ifconfig ${epair_two}a inet 198.51.100.129/25 + jexec carp_uni_v4_two sysctl net.inet.ip.forwarding=1 jexec carp_uni_v4_two ifconfig ${epair_one}b 198.51.100.2/25 up - jexec carp_uni_v4_two route add default 198.51.100.1 + jexec carp_uni_v4_two route add 198.51.100.224 198.51.100.1 + # A peer address x.x.x.224 to catch PR 284872 jexec carp_uni_v4_two ifconfig ${epair_one}b add vhid 1 \ - peer 198.51.100.130 192.0.2.1/29 + peer 198.51.100.224 192.0.2.1/32 - jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.130/25 up - jexec carp_uni_v4_three route add default 198.51.100.129 + jexec carp_uni_v4_three sysctl net.inet.ip.forwarding=1 + jexec carp_uni_v4_three ifconfig ${epair_two}b 198.51.100.224/25 up + jexec carp_uni_v4_three route add 198.51.100.2 198.51.100.129 jexec carp_uni_v4_three ifconfig ${epair_two}b add vhid 1 \ - peer 198.51.100.2 192.0.2.1/29 + peer 198.51.100.2 192.0.2.1/32 # Sanity check atf_check -s exit:0 -o ignore jexec carp_uni_v4_two \ - ping -c 1 198.51.100.130 + ping -c 1 198.51.100.224 wait_for_carp carp_uni_v4_two ${epair_one}b \ carp_uni_v4_three ${epair_two}b + # Setup RIPv2 route daemon + jexec carp_uni_v4_two routed -s -Pripv2 + jexec carp_uni_v4_three routed -s -Pripv2 + jexec carp_uni_v4_one routed -Pripv2 + + # XXX Wait for route propagation + sleep 3 + atf_check -s exit:0 -o ignore jexec carp_uni_v4_one \ ping -c 3 192.0.2.1 # Check that we remain in unicast when tweaking settings atf_check -s exit:0 -o ignore \ jexec carp_uni_v4_two ifconfig ${epair_one}b vhid 1 advskew 2 - atf_check -s exit:0 -o match:"peer 198.51.100.130" \ + atf_check -s exit:0 -o match:"peer 198.51.100.224" \ jexec carp_uni_v4_two ifconfig ${epair_one}b }