@@ -149,6 +149,74 @@ match_src_ip_test()
149
149
log_test " src_ip match ($tcflags )"
150
150
}
151
151
152
+ match_ip_flags_test ()
153
+ {
154
+ RET=0
155
+
156
+ tc filter add dev $h2 ingress protocol ip pref 1 handle 101 flower \
157
+ $tcflags ip_flags frag action continue
158
+ tc filter add dev $h2 ingress protocol ip pref 2 handle 102 flower \
159
+ $tcflags ip_flags firstfrag action continue
160
+ tc filter add dev $h2 ingress protocol ip pref 3 handle 103 flower \
161
+ $tcflags ip_flags nofirstfrag action continue
162
+ tc filter add dev $h2 ingress protocol ip pref 4 handle 104 flower \
163
+ $tcflags ip_flags nofrag action drop
164
+
165
+ $MZ $h1 -c 1 -p 1000 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
166
+ -t ip " frag=0" -q
167
+
168
+ tc_check_packets " dev $h2 ingress" 101 1
169
+ check_fail $? " Matched on wrong frag filter (nofrag)"
170
+
171
+ tc_check_packets " dev $h2 ingress" 102 1
172
+ check_fail $? " Matched on wrong firstfrag filter (nofrag)"
173
+
174
+ tc_check_packets " dev $h2 ingress" 103 1
175
+ check_err $? " Did not match on nofirstfrag filter (nofrag) "
176
+
177
+ tc_check_packets " dev $h2 ingress" 104 1
178
+ check_err $? " Did not match on nofrag filter (nofrag)"
179
+
180
+ $MZ $h1 -c 1 -p 1000 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
181
+ -t ip " frag=0,mf" -q
182
+
183
+ tc_check_packets " dev $h2 ingress" 101 1
184
+ check_err $? " Did not match on frag filter (1stfrag)"
185
+
186
+ tc_check_packets " dev $h2 ingress" 102 1
187
+ check_err $? " Did not match fistfrag filter (1stfrag)"
188
+
189
+ tc_check_packets " dev $h2 ingress" 103 1
190
+ check_err $? " Matched on wrong nofirstfrag filter (1stfrag)"
191
+
192
+ tc_check_packets " dev $h2 ingress" 104 1
193
+ check_err $? " Match on wrong nofrag filter (1stfrag)"
194
+
195
+ $MZ $h1 -c 1 -p 1000 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
196
+ -t ip " frag=256,mf" -q
197
+ $MZ $h1 -c 1 -p 1000 -a $h1mac -b $h2mac -A 192.0.2.1 -B 192.0.2.2 \
198
+ -t ip " frag=256" -q
199
+
200
+ tc_check_packets " dev $h2 ingress" 101 3
201
+ check_err $? " Did not match on frag filter (no1stfrag)"
202
+
203
+ tc_check_packets " dev $h2 ingress" 102 1
204
+ check_err $? " Matched on wrong firstfrag filter (no1stfrag)"
205
+
206
+ tc_check_packets " dev $h2 ingress" 103 3
207
+ check_err $? " Did not match on nofirstfrag filter (no1stfrag)"
208
+
209
+ tc_check_packets " dev $h2 ingress" 104 1
210
+ check_err $? " Matched on nofrag filter (no1stfrag)"
211
+
212
+ tc filter del dev $h2 ingress protocol ip pref 1 handle 101 flower
213
+ tc filter del dev $h2 ingress protocol ip pref 2 handle 102 flower
214
+ tc filter del dev $h2 ingress protocol ip pref 3 handle 103 flower
215
+ tc filter del dev $h2 ingress protocol ip pref 4 handle 104 flower
216
+
217
+ log_test " ip_flags match ($tcflags )"
218
+ }
219
+
152
220
setup_prepare ()
153
221
{
154
222
h1=${NETIFS[p1]}
@@ -181,6 +249,7 @@ match_dst_mac_test
181
249
match_src_mac_test
182
250
match_dst_ip_test
183
251
match_src_ip_test
252
+ match_ip_flags_test
184
253
185
254
tc_offload_check
186
255
if [[ $? -ne 0 ]]; then
191
260
match_src_mac_test
192
261
match_dst_ip_test
193
262
match_src_ip_test
263
+ match_ip_flags_test
194
264
fi
195
265
196
266
exit $EXIT_STATUS
0 commit comments