-
Notifications
You must be signed in to change notification settings - Fork 10
/
test-tc-insert-rules-frag.sh
executable file
·53 lines (41 loc) · 1.13 KB
/
test-tc-insert-rules-frag.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
#
# Bug SW #1334271: Syndrome 0xd5ef2 when sending fragmented packets
#
# Currently we do not support offloading of frag first/later so verify this.
#
NIC=${1:-ens5f0}
my_dir="$(dirname "$0")"
. $my_dir/common.sh
enable_switchdev
REP=`get_rep 0`
if [ -z "$REP" ]; then
fail "Missing rep $rep"
fi
function test_tc_filter() {
local a
local err
local opnotsupp
a=`eval tc filter $@ 2>&1`
err=$?
echo $a
echo "$a" | grep -q "Operation not supported" && true || false
opnotsupp=$?
if [ $err != 0 ] && [ $opnotsupp == 0 ]; then
success $reason
else
err $reason
fi
}
reset_tc_nic $NIC
start_check_syndrome
reason="Expected to fail with reason EOPNOTSUPP"
title "Test fragfirst rule"
test_tc_filter add dev $NIC protocol ip parent ffff: flower skip_sw ip_flags firstfrag \
dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 action drop
title "Test nofragfirst rule"
test_tc_filter add dev $NIC protocol ip parent ffff: flower skip_sw ip_flags nofirstfrag \
dst_mac e4:11:22:11:4a:51 src_mac e4:11:22:11:4a:50 action drop
reset_tc_nic $NIC
check_syndrome
test_done