Commit 25a26f0c authored by Ido Schimmel's avatar Ido Schimmel Committed by Jakub Kicinski

selftests: mlxsw: Add a test for EAPOL trap

Test that packets with a destination MAC of 01:80:C2:00:00:03 trigger
the "eapol" packet trap.
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Reviewed-by: default avatarPetr Machata <petrm@nvidia.com>
Signed-off-by: default avatarPetr Machata <petrm@nvidia.com>
Reviewed-by: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent da23a713
...@@ -83,6 +83,7 @@ ALL_TESTS=" ...@@ -83,6 +83,7 @@ ALL_TESTS="
ptp_general_test ptp_general_test
flow_action_sample_test flow_action_sample_test
flow_action_trap_test flow_action_trap_test
eapol_test
" "
NUM_NETIFS=4 NUM_NETIFS=4
source $lib_dir/lib.sh source $lib_dir/lib.sh
...@@ -677,6 +678,27 @@ flow_action_trap_test() ...@@ -677,6 +678,27 @@ flow_action_trap_test()
tc qdisc del dev $rp1 clsact tc qdisc del dev $rp1 clsact
} }
eapol_payload_get()
{
local source_mac=$1; shift
local p
p=$(:
)"01:80:C2:00:00:03:"$( : ETH daddr
)"$source_mac:"$( : ETH saddr
)"88:8E:"$( : ETH type
)
echo $p
}
eapol_test()
{
local h1mac=$(mac_get $h1)
devlink_trap_stats_test "EAPOL" "eapol" $MZ $h1 -c 1 \
$(eapol_payload_get $h1mac) -p 100 -q
}
trap cleanup EXIT trap cleanup EXIT
setup_prepare setup_prepare
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment