2 # SPDX-License-Identifier: GPL-2.0
4 ALL_TESTS="loopback_test"
11 simple_if_init $h1 192.0.2.1/24
12 tc qdisc add dev $h1 clsact
17 tc qdisc del dev $h1 clsact
18 simple_if_fini $h1 192.0.2.1/24
35 tc filter add dev $h1 ingress protocol arp pref 1 handle 101 flower \
36 skip_hw arp_op reply arp_tip 192.0.2.1 action drop
38 $MZ $h1 -c 1 -t arp -q
40 tc_check_packets "dev $h1 ingress" 101 1
41 check_fail $? "Matched on a filter without loopback setup"
43 ethtool -K $h1 loopback on
44 check_err $? "Failed to enable loopback"
48 $MZ $h1 -c 1 -t arp -q
50 tc_check_packets "dev $h1 ingress" 101 1
51 check_err $? "Did not match on filter with loopback"
53 ethtool -K $h1 loopback off
54 check_err $? "Failed to disable loopback"
56 $MZ $h1 -c 1 -t arp -q
58 tc_check_packets "dev $h1 ingress" 101 2
59 check_fail $? "Matched on a filter after loopback was removed"
61 tc filter del dev $h1 ingress protocol arp pref 1 handle 101 flower