From nobody Sun Oct 5 20:51:51 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 4cfvhl4VMHz6BfjL; Sun, 05 Oct 2025 20:51:51 +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 "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4cfvhl1ftWz3wS8; Sun, 05 Oct 2025 20:51:51 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697511; 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=JXeJvqIGZvhj30aar3/ZmmS/oV07RZR8S3AAfO5+tQU=; b=i77K/FX1yEmUgHL8fJqe8ISd+9ksXIW1drupFrMRhJomE9Fl13TkW+xbF4wpSHV1NBYMx6 012VCpoyxqvYtwUwOYgjWpIlkIE5N5kcYwBw/4r/SNNhuaoDtZRG08p+Ll1O3oD0f1RPCh wnXHa+UFaHWaR6eTtmallfwCEbK4Acg3EEvlfBmV7MQOjLwhFy/BbFY/INQN1ZmpQQw0HL 95cljgbmXG5ksd6Pe84ngo5lEhM8lIU7fqqMsYQXTBKjEis/dLzYSHSw/L2Zeydr+hSYAt VkBI/GZUSdZev4AQpsZSnVVjtCvnjTXO5zVn4blhTu/m5xDYp/b5IiU8DIJCcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1759697511; 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=JXeJvqIGZvhj30aar3/ZmmS/oV07RZR8S3AAfO5+tQU=; b=H3FCGVvBumiJhocjRfZW4F4fKsAspPXKed0AwRBXAQDsUP/QD/cv4JKyYWWSroC0xByvWN qmnxvxPVvwsNIVsOesMWUSRSiyof5l5FkSJqQC7cEGdT4GHT6iasOa3THKBCm4hymU/Lkf 3wSmVg3Z3373JSJyJPnpdv8vjcuLakjlL0mOC8plxCb1Abctah3vgnY9GS3zFWy/1lrQRM d6frsArkZeTyEGdAb5rZ2pUGAhxpFjgan4WonVO5bCQp1fPFU3qjoAkNyn5I9tzxKWGSqF uP+jHarx52gpjqRxyhPWK2sYZh+ZLfFK02McMqHDOXwfcSPL9WqnzumMRdElPg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1759697511; a=rsa-sha256; cv=none; b=gaA5XKQSSIef7FmlYxTiTLAwHu5Pbl1vUDvbFhN8Hu+Lc7cziz8bK1Jpjy/1pMui9me9DE WjCwG0fC+HeZoXymOZlmZAzn0osfHsvG2LVpI+WWXWguHEHWmQU7+XlNF/c06ZV8s6QksP w9zcEZMAUylu+YV7jaY1co+p4nu8rTC4YbXnFMgyLRqgglImMUYAJ458gla2Hi2piKy8xK K3U79fTMV3xRrII2EvHlqVJGO7cJ7Pi3NCsxQWcfJKjKRUhYOvCbLP8aujj4tb6RfRST4C xdrAHi7xzOk8dgpa+Kkjo04sLQXkMioS8E3Outm7yKVnGqfY0GbbyHugVzDe0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4cfvhl1BbHzD3K; Sun, 05 Oct 2025 20:51:51 +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 595KppVh040930; Sun, 5 Oct 2025 20:51:51 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 595Kpp5S040927; Sun, 5 Oct 2025 20:51:51 GMT (envelope-from git) Date: Sun, 5 Oct 2025 20:51:51 GMT Message-Id: <202510052051.595Kpp5S040927@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: 3e79ec993dc7 - stable/15 - pf tests: fix intermittent mld test failures 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/stable/15 X-Git-Reftype: branch X-Git-Commit: 3e79ec993dc7f6a454705ff5e820aa977583a5f7 Auto-Submitted: auto-generated The branch stable/15 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=3e79ec993dc7f6a454705ff5e820aa977583a5f7 commit 3e79ec993dc7f6a454705ff5e820aa977583a5f7 Author: Kristof Provost AuthorDate: 2025-09-27 14:41:30 +0000 Commit: Kristof Provost CommitDate: 2025-10-05 20:47:35 +0000 pf tests: fix intermittent mld test failures We can't reliably check for the absence of replies to our MLD queries (because a host may announce its multicast subscriptions), so enable pf logging and check for the relevant error message instead. PR: 289821 MFC after: 1 week Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D52762 (cherry picked from commit a57f6ce4792f12bebdbe3e46d6d9d39da10055db) --- tests/sys/netpfil/pf/Makefile | 2 +- tests/sys/netpfil/pf/mld.py | 35 +++++++++++++++-------------------- 2 files changed, 16 insertions(+), 21 deletions(-) diff --git a/tests/sys/netpfil/pf/Makefile b/tests/sys/netpfil/pf/Makefile index d63431e64a96..720086bbbccd 100644 --- a/tests/sys/netpfil/pf/Makefile +++ b/tests/sys/netpfil/pf/Makefile @@ -71,7 +71,7 @@ ATF_TESTS_PYTEST+= tcp.py # Allow tests to run in parallel in their own jails TEST_METADATA+= execenv="jail" -TEST_METADATA+= execenv_jail_params="vnet allow.raw_sockets" +TEST_METADATA+= execenv_jail_params="vnet allow.raw_sockets allow.read_msgbuf" ${PACKAGE}FILES+= \ bsnmpd.conf \ diff --git a/tests/sys/netpfil/pf/mld.py b/tests/sys/netpfil/pf/mld.py index d118a34c8a7d..b3ef6c21b3de 100644 --- a/tests/sys/netpfil/pf/mld.py +++ b/tests/sys/netpfil/pf/mld.py @@ -32,23 +32,22 @@ from atf_python.sys.net.vnet import VnetTestTemplate class TestMLD(VnetTestTemplate): REQUIRED_MODULES = [ "pf" ] TOPOLOGY = { - "vnet1": {"ifaces": ["if1"]}, + "vnet1": {"ifaces": ["if1"], "opts": ["allow.read_msgbuf"]}, "vnet2": {"ifaces": ["if1"]}, "if1": {"prefixes6": [("2001:db8::2/64", "2001:db8::1/64")]}, } def vnet2_handler(self, vnet): ifname = vnet.iface_alias_map["if1"].name - #ToolsHelper.print_output("/sbin/pfctl -e") + ToolsHelper.print_output("/sbin/pfctl -e") ToolsHelper.pf_rules([ "pass", ]) ToolsHelper.print_output("/sbin/pfctl -x loud") - #ToolsHelper.print_output("echo \"j 230.0.0.1 %s\ns 3600\nq\" | /usr/sbin/mtest" % ifname) def find_mld_reply(self, pkt, ifname): pkt.show() - s = DelayedSend(pkt) + s = DelayedSend(pkt, ifname) found = False packets = self.sp.sniff(iface=ifname, timeout=5) @@ -66,7 +65,6 @@ class TestMLD(VnetTestTemplate): def test_router_alert(self): """Verify that we allow MLD packets with router alert extension header""" ifname = self.vnet.iface_alias_map["if1"].name - #ToolsHelper.print_output("/sbin/ifconfig %s inet6 -ifdisable" % ifname) ToolsHelper.print_output("/sbin/ifconfig") # Import in the correct vnet, so at to not confuse Scapy @@ -76,20 +74,17 @@ class TestMLD(VnetTestTemplate): self.sp = sp self.sc = sc - # A correct MLD query gets a reply - pkt = sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=1) \ - / sp.RouterAlert(value=0) \ + # MLD packets with an incorrect hop limit get dropped. + pkt = sp.Ether() \ + / sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=2) \ + / sp.IPv6ExtHdrHopByHop(options=[ \ + sp.RouterAlert(value=0) \ + ]) \ / sp.ICMPv6MLQuery2() - assert self.find_mld_reply(pkt, ifname) + # We can't reliably test this by checking for a reply, because + # the other jail may just send a spontaneous MLD reply. + self.find_mld_reply(pkt, ifname) - # The wrong extension header does not - pkt = sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=1) \ - / sp.IPv6ExtHdrRouting() \ - / sp.ICMPv6MLQuery2() - assert not self.find_mld_reply(pkt, ifname) - - # Neither does an incorrect hop limit - pkt = sp.IPv6(src="fe80::1%%%s" % ifname, dst="ff02::1", hlim=2) \ - / sp.RouterAlert(value=0) \ - / sp.ICMPv6MLQuery2() - assert not self.find_mld_reply(pkt, ifname) + # Check if we logged dropping the MLD paacket + dmesg = ToolsHelper.get_output("/sbin/dmesg") + assert dmesg.find("Invalid MLD") != -1