From nobody Tue Feb 25 04:01:57 2025 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 4Z23nx72H2z5pNTP; Tue, 25 Feb 2025 04:01:57 +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 4Z23nx6YYmz3xRB; Tue, 25 Feb 2025 04:01:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1740456117; 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=mkuC1e/HKSC5+NEbk0LpT3SsNxJqRT9VHJcMZ8VuqXY=; b=fWDWr4+umgvNerDZ6PsrxGNv8eJvrjcyfreuR6qovwJ0FGYoETNGrSrfcTP5b6dPO1n7NG K7DaAEZFaj8zaGClSxFHRj1UXQexZRvNo/oxJubNbSbCVkz7DWkDMfvA3QRr2yHo9T8rOS 95++X+aHAvkHStDfgwE66FabYRnCpPN4ySbwPM6na5Sqhqh34wee19yk9NJika+OQrmaef /Dqb16pmxEyFXy4MAtkpTVtAjdvqIBTpir44sBikck26uVEjJEuh0tNQwtgOo1cIzZ5YW1 BEcbLdlL3XC//Ced+dca13Y1JxXcBH8KUZWFBG0sDNi1MvuC/AOKl31PzEV+uQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1740456117; a=rsa-sha256; cv=none; b=lMPiDLHsZiN/ebZXvPjeiXma9wT0oYy/s/oyDWGJrOVIrroc61Vs0rj0nmMWJMQ43I3O32 GhcqPVpgd7vovjbNyiQU0drnDeUFk7+Agam7EpcjQQwIc9vhHvb9GMTMB89VnX38GZPuAa uPUXE31x0Qj+eBNUfWOoSXSjDNTdgQhXI9Fg5Gqhhyx6CqDgNljwICgI3hXkiBmnDjxT0M qSe7oXkHkV7orkZewP8bmHeeGz+NAUvG4t7KbsiLSJE9kriob+k+ezVrf25sYVH8A+JQ+e IR4K9b67wfop7WuyVhl9LKxXhtuWEGW8C21aT4BMAzhUhmCxd/MUARHYk9J3Vw== 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=1740456117; 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=mkuC1e/HKSC5+NEbk0LpT3SsNxJqRT9VHJcMZ8VuqXY=; b=DkoElDIuTfNND03zHX2fsBc+NYFVsCheO52NPPmGs4ON8+BN1agTOeJAOVyyHO6fhpWYBq 1TQQ15uGnjBGuuoAs4Q+teVDEAUQ4g84kfJR3+02PPmYos45bT0N4XDENMYQEd6k7aqIfJ gy9GyPdDbkWDbITXLmwn2JsigsAqzEWYnld6yyDm37e3sAu5CoY4glNdV9OpOhbBOFCZls Rr2FmhMON6EmPIrpJaDyAff91VrhT7CxQa3VO/J9C2gpOt6qtbAjSGa7jO4nlscqD4XzcZ msIeglv7AMOYYXhWJHgcrxx/yF/gE7ipqK6stGJDR7cAOVsRtcyWuLYjEVAyeA== 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 4Z23nx68mRz18qq; Tue, 25 Feb 2025 04:01: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 51P41vqD086297; Tue, 25 Feb 2025 04:01:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51P41v1n086294; Tue, 25 Feb 2025 04:01:57 GMT (envelope-from git) Date: Tue, 25 Feb 2025 04:01:57 GMT Message-Id: <202502250401.51P41v1n086294@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: d8d8b9c9ca38 - stable/14 - tests: carp: Update test case unicast_v4 to catch PR 284872 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: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d8d8b9c9ca387217bf70b2db1038529d80af280b Auto-Submitted: auto-generated The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=d8d8b9c9ca387217bf70b2db1038529d80af280b commit d8d8b9c9ca387217bf70b2db1038529d80af280b Author: Zhenlei Huang AuthorDate: 2025-02-22 19:26:32 +0000 Commit: Zhenlei Huang CommitDate: 2025-02-25 04:01:22 +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 (cherry picked from commit 93fbdef51a13b8facac3633f55804a59ca27f635) --- 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 8cea2f4cbf1b..e14bedb4f878 100755 --- a/tests/sys/netinet/carp.sh +++ b/tests/sys/netinet/carp.sh @@ -116,49 +116,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 }