lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240814130618.2885431-7-boris.sukholitko@broadcom.com>
Date: Wed, 14 Aug 2024 16:06:18 +0300
From: Boris Sukholitko <boris.sukholitko@...adcom.com>
To: netdev@...r.kernel.org,
	"David S . Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	Jamal Hadi Salim <jhs@...atatu.com>,
	Cong Wang <xiyou.wangcong@...il.com>,
	Jiri Pirko <jiri@...nulli.us>,
	Mina Almasry <almasrymina@...gle.com>,
	Pavel Begunkov <asml.silence@...il.com>,
	Alexander Lobakin <aleksander.lobakin@...el.com>,
	Lorenzo Bianconi <lorenzo@...nel.org>,
	David Howells <dhowells@...hat.com>
Cc: Ilya Lifshits <ilya.lifshits@...adcom.com>
Subject: [PATCH net-next v2 6/6] selftests: forwarding: tc_actions: test vlan flush

Add new test checking the correctness of inner vlan flushing to the skb
data when outer vlan tag is added through act_vlan.

Signed-off-by: Boris Sukholitko <boris.sukholitko@...adcom.com>
---
 .../selftests/net/forwarding/tc_actions.sh    | 22 ++++++++++++++++++-
 1 file changed, 21 insertions(+), 1 deletion(-)

diff --git a/tools/testing/selftests/net/forwarding/tc_actions.sh b/tools/testing/selftests/net/forwarding/tc_actions.sh
index 589629636502..65ff80d66b17 100755
--- a/tools/testing/selftests/net/forwarding/tc_actions.sh
+++ b/tools/testing/selftests/net/forwarding/tc_actions.sh
@@ -4,7 +4,7 @@
 ALL_TESTS="gact_drop_and_ok_test mirred_egress_redirect_test \
 	mirred_egress_mirror_test matchall_mirred_egress_mirror_test \
 	gact_trap_test mirred_egress_to_ingress_test \
-	mirred_egress_to_ingress_tcp_test"
+	mirred_egress_to_ingress_tcp_test vlan_flush_test"
 NUM_NETIFS=4
 source tc_common.sh
 source lib.sh
@@ -244,6 +244,26 @@ mirred_egress_to_ingress_tcp_test()
 	log_test "mirred_egress_to_ingress_tcp ($tcflags)"
 }
 
+vlan_flush_test()
+{
+	ip link add x$h1 type veth peer x$h2
+	ip link set x$h1 up
+	ip link set x$h2 up
+
+	tc qdisc add dev x$h1 clsact
+	tc filter add dev x$h1 ingress pref 20 chain 0 handle 20 flower num_of_vlans 1 \
+		action vlan push id 100 protocol 0x8100 action goto chain 5
+	tc filter add dev x$h1 ingress pref 30 chain 5 handle 30 flower num_of_vlans 2 \
+		cvlan_ethtype 0x800 action pass
+
+	$MZ x$h2 -t udp -Q 10 -q
+	tc_check_packets "dev x$h1 ingress" 30 1
+	check_err $? "No double-vlan packets received"
+
+	ip link del x$h1
+	log_test "vlan_flush_test ($tcflags)"
+}
+
 setup_prepare()
 {
 	h1=${NETIFS[p1]}
-- 
2.42.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ