From nobody Fri Apr 14 11:20:47 2023 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 4PyYsX4fyXz4538f; Fri, 14 Apr 2023 11:20:48 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PyYsX1h4nz3vb3; Fri, 14 Apr 2023 11:20:48 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681471248; 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=jOPQa0/uvuanCqL9/wKqtGJHHqUTzXrbdiJQN8TcCbg=; b=QGOLGOQpeiU6rhV7AYeewN6VBE0cJ2wah4Cj9Wwn3/QK+Iosu3ENeCBiitdohOHpDUVs7E aI4VTHGAsJkLAijYsJjN5PyUti/1w81kqD9KYohNZCTSFI9oP6f+o1VbM+ga4GRvY9EeL/ 4xrRESCYzwOJVEk9GfupB7yau64yI/qd32xX47Rjj42TBq/iP7ywOq63n2h4DlbrCYaOf/ e6Nfi604UoJtbgzmyBaLnZ57aP5pFByHAPTJzYyJrE/zlxLaNkKxumewBYuEMAcK2NGviq yylLWlttBTwf/7h7yWR4QZR9XtYgRW0Yr+b4/1mhP3qT2gYD1x38vkJY8+u+Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1681471248; 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=jOPQa0/uvuanCqL9/wKqtGJHHqUTzXrbdiJQN8TcCbg=; b=HvFDzOIXhpqkzbfVVZAsNWW/oK8OfQmohBB4/3taahS0Ck6PKXReVe4pG/lJooh9RYw5nZ YAJmifs4AztIKq1DV8XUiWZuHOqZW4J6lk+LQAXBqebXvx4EeqP0OwoLENtZtrxBEpBnIg 5UtLtFgbERxyxPzoRgk0xWfFM6xrXtdFiT26CqGuTYWz29DpqqzN/b2CxWBZ2NqPjeU8h6 7Rywr34c1OPI6LZK+4OuxzUyMdBHdfGywnyLgblBVSnsoQJelLaG7g5DSuYgU31r5iFLj8 kets07HPCU4ZPQnDK8N9VZdS+QbWAtdsgmpOtQXRdkBHssyO7SX7pE2gtuDadg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1681471248; a=rsa-sha256; cv=none; b=tzezdMI0DKn1MAAPyb1V1Q9d/K5YlWullkIttleo3lwfcEagl0PXT1ydW2L1icqFdx4F6P Wq1jdFTROONxxqnhNJDS9b7FO0YF1l7gOy3JpZ8T8ZHD3Ih8GM03j6ZZff3l7ipvrc0Q2L 8WEMiciGYk5cyNFEiXRTU9o+kj6YKC6mjnB6ogrtTL0ckVcwpM1bd5otc+YC/FbQgjWdon Ov7H5RXAq3GJ63Oe/OwGxJpaMKpcna+VVQz+3Bixl1CmG4jBDtxpaOT87ODKjiuZeSozGX 7xGKbl29rvc9YKrrxUZ+FDWLi9L/iJsUZXPc/m00oQ8FFB6ia8zlJZ0YFjNjDQ== 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 4PyYsW6pJbzMLV; Fri, 14 Apr 2023 11:20:47 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 33EBKlFT023430; Fri, 14 Apr 2023 11:20:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 33EBKlm2023419; Fri, 14 Apr 2023 11:20:47 GMT (envelope-from git) Date: Fri, 14 Apr 2023 11:20:47 GMT Message-Id: <202304141120.33EBKlm2023419@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: f97802a35e48 - main - bridge tests: test cross-vlan bridging 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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: f97802a35e484ee0f8e11d3956189392ea995b29 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=f97802a35e484ee0f8e11d3956189392ea995b29 commit f97802a35e484ee0f8e11d3956189392ea995b29 Author: Kristof Provost AuthorDate: 2023-04-07 16:02:35 +0000 Commit: Kristof Provost CommitDate: 2023-04-14 11:17:02 +0000 bridge tests: test cross-vlan bridging Ensure that the bridge takes VLAN IDs into account when learning addresses. PR: 270559 Differential Revision: https://reviews.freebsd.org/D39379 --- tests/sys/net/if_bridge_test.sh | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/tests/sys/net/if_bridge_test.sh b/tests/sys/net/if_bridge_test.sh index 42f65936d038..1d8c4d317090 100755 --- a/tests/sys/net/if_bridge_test.sh +++ b/tests/sys/net/if_bridge_test.sh @@ -597,6 +597,73 @@ mtu_cleanup() vnet_cleanup } +atf_test_case "vlan" "cleanup" +vlan_head() +{ + atf_set descr 'Ensure the bridge takes vlan ID into account, PR#270559' + atf_set require.user root +} + +vlan_body() +{ + vnet_init + + vid=1 + + epaira=$(vnet_mkepair) + epairb=$(vnet_mkepair) + + br=$(vnet_mkbridge) + + vnet_mkjail one ${epaira}b + vnet_mkjail two ${epairb}b + + ifconfig ${br} up + ifconfig ${epaira}a up + ifconfig ${epairb}a up + ifconfig ${br} addm ${epaira}a addm ${epairb}a + + jexec one ifconfig ${epaira}b up + jexec one ifconfig ${epaira}b.${vid} create + + jexec two ifconfig ${epairb}b up + jexec two ifconfig ${epairb}b.${vid} create + + # Create a MAC address conflict between an untagged and tagged interface + jexec two ifconfig ${epairb}b.${vid} ether 02:05:6e:06:28:1a + jexec one ifconfig ${epaira}b ether 02:05:6e:06:28:1a + jexec one ifconfig ${epaira}b.${vid} ether 02:05:6e:06:28:1b + + # Add ip address, will also populate $br's fowarding table, by ARP announcement + jexec one ifconfig ${epaira}b.${vid} 192.0.2.1/24 up + jexec two ifconfig ${epairb}b.${vid} 192.0.2.2/24 up + + sleep 0.5 + + ifconfig ${br} + jexec one ifconfig + jexec two ifconfig + ifconfig ${br} addr + + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 -t 1 192.0.2.2 + + # This will trigger a mac flap (by ARP announcement) + jexec one ifconfig ${epaira}b 192.0.2.1/24 up + + sleep 0.5 + + ifconfig ${br} addr + + atf_check -s exit:0 -o ignore \ + jexec one ping -c 1 -t 1 192.0.2.2 +} + +vlan_cleanup() +{ + vnet_cleanup +} + atf_init_test_cases() { atf_add_test_case "bridge_transmit_ipv4_unicast" @@ -610,4 +677,5 @@ atf_init_test_cases() atf_add_test_case "stp_validation" atf_add_test_case "gif" atf_add_test_case "mtu" + atf_add_test_case "vlan" }