From nobody Sat Jul 5 07:13:21 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 4bZ1tq1t4mz61BdR; Sat, 05 Jul 2025 07:13:23 +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 4bZ1tp0GqVz44J3; Sat, 05 Jul 2025 07:13:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751699602; 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=/mXVxV1wWaaM0fiZPH3Mxm5udfebajqJkxHsu+IbjEI=; b=TAbw/BpKTq/xfogfq8SbuwKUiq1I3ByyA3cVqCzogu8Tr/GQqfWJ6Rog7V2nDJgiIcgjpk BVP9Qw6blLpzk1ZC2B1xRbVKcB+1Ob0XQEcSfWv0sL1+r+FjlNGb8JtND8+6ewbZ4GguP6 Kop6ILyNOw7QG+2yQdhxt1PE639cTfUsUWWl0q9pZOkM/RAWuYL/AkMTKniR9lEntwmke5 RW0YsnokmiX955VTwq0fBrkzdPC9P0lCWV3qDX2LUP+NFtW5652Cf77Il67m8POca4S+60 Uw7ydagc2yWwSA8/Af15eGT5R9rM0WhbS6XmwDgiImM7kEUvoVPFF+P42942Lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1751699602; 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=/mXVxV1wWaaM0fiZPH3Mxm5udfebajqJkxHsu+IbjEI=; b=dbQ/ZCSZccCihXIe7zmlqCZs+Dne17NowXCFfcxeE0pJB4h8Q8SaWU38pO28p17d5Qj7on 576riv4vxIPTOdeA0YdFqPgHqo00frtzv1KOqb+vQcBJs7ofkqYOKSbDVAW3unGbF54LYp 8T9VDLDkxgagrKxZVwsJNBdN5UErRriimFEoZ8nATIMV8osBVFbAZxZCEqPfRC8Z+hIp9d iUOW7WVPsqAVLHrnPdtOL3L062YG90eLvLqG0xuJvr0rZKQS/I0NIJ5obuusXPJ0dzCaas RzneZNWiCgmHJ3HQ0NE9dFvxOmL+i6aknbtnOPTYjF1vH9I3hd1pPmS6asz7kA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1751699602; a=rsa-sha256; cv=none; b=vAoOqStjBioAqdODI9i5ec7hEL4iXrwidZjscBvwiC3Mwz6yBDw31WQ2fkeYMLhygww8bN n3N4QR839nVUN3vROBIXEPPYXXxtYTJTLsyIrSImsmS5SM2ZmrtfFi9KtY7PmG6wP8q7rG d0W89VzguL0RgKcRnpysCv+NMPUWofZdx6gpU1L5svb1lYApvcToCtUQx9vkEsVr7lujGA YdDuAtfJabLzvb+RrADQNN+lzI7PjN0Y4B6B3VG2EdGxLcUPSzlkZm5ADvUv84rihuv0Q9 Lz17aLgJGXyyaysOko+/mSaflXpjrSk1pQCTRkTL5261ymD3V5yRWWQIYwWxsg== 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 4bZ1tn3rhfz9Y9; Sat, 05 Jul 2025 07:13:21 +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 5657DL4i017648; Sat, 5 Jul 2025 07:13:21 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 5657DLF1017645; Sat, 5 Jul 2025 07:13:21 GMT (envelope-from git) Date: Sat, 5 Jul 2025 07:13:21 GMT Message-Id: <202507050713.5657DLF1017645@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Lexi Winter Subject: git: c5f5d0cf49bf - main - if_bridge_test: add a test for QinQ (802.1ad) 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: ivy X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c5f5d0cf49bfa042aa6f8416449010370853e2bc Auto-Submitted: auto-generated The branch main has been updated by ivy: URL: https://cgit.FreeBSD.org/src/commit/?id=c5f5d0cf49bfa042aa6f8416449010370853e2bc commit c5f5d0cf49bfa042aa6f8416449010370853e2bc Author: Lexi Winter AuthorDate: 2025-07-05 06:57:33 +0000 Commit: Lexi Winter CommitDate: 2025-07-05 07:08:09 +0000 if_bridge_test: add a test for QinQ (802.1ad) Reviewed by: kp, des Approved by: des (mentor) Differential Revision: https://reviews.freebsd.org/D50577 --- tests/sys/net/if_bridge_test.sh | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index d057d2997486..cc0b212aebd2 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -1164,6 +1164,63 @@ vlan_svi_cleanup() vnet_cleanup } +# +# Test QinQ (802.1ad). +# +atf_test_case "vlan_qinq" "cleanup" +vlan_qinq_head() +{ + atf_set descr 'vlan filtering with QinQ traffic' + atf_set require.user root +} + +vlan_qinq_body() +{ + vnet_init + vnet_init_bridge + + epone=$(vnet_mkepair) + eptwo=$(vnet_mkepair) + + vnet_mkjail one ${epone}b + vnet_mkjail two ${eptwo}b + + # Create a QinQ trunk between the two jails. The outer (provider) tag + # is 5, and the inner tag is 10. + + jexec one ifconfig ${epone}b up + jexec one ifconfig ${epone}b.5 create vlanproto 802.1ad up + jexec one ifconfig ${epone}b.5.10 create inet 192.0.2.1/24 up + + jexec two ifconfig ${eptwo}b up + jexec two ifconfig ${eptwo}b.5 create vlanproto 802.1ad up + jexec two ifconfig ${eptwo}b.5.10 create inet 192.0.2.2/24 up + + bridge=$(vnet_mkbridge) + + ifconfig ${bridge} up + ifconfig ${epone}a up + ifconfig ${eptwo}a up + ifconfig ${bridge} addm ${epone}a vlanfilter ${epone}a + ifconfig ${bridge} addm ${eptwo}a vlanfilter ${eptwo}a + + # Right now there are no VLANs on the access list, so everything + # should be blocked. + atf_check -s exit:2 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 + atf_check -s exit:2 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 + + # Add the provider tag to the access list; now traffic should be passed. + ifconfig ${bridge} +tagged ${epone}a 5 + ifconfig ${bridge} +tagged ${eptwo}a 5 + atf_check -s exit:0 -o ignore jexec one ping -c 3 -t 1 192.0.2.2 + atf_check -s exit:0 -o ignore jexec two ping -c 3 -t 1 192.0.2.1 +} + +vlan_qinq_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -1189,4 +1246,5 @@ atf_init_test_cases() atf_add_test_case "vlan_filtering" atf_add_test_case "vlan_ifconfig_tagged" atf_add_test_case "vlan_svi" + atf_add_test_case "vlan_qinq" }