File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
tools/testing/selftests/bpf Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,20 @@ echo "Testing IPv4 + GRE..."
139
139
140
140
tc filter del dev lo ingress pref 1337
141
141
142
+ echo " Testing port range..."
143
+ # Drops all IP/UDP packets coming from port 8-10
144
+ tc filter add dev lo parent ffff: protocol ip pref 1337 flower ip_proto \
145
+ udp src_port 8-10 action drop
146
+
147
+ # Send 10 IPv4/UDP packets from port 7. Filter should not drop any.
148
+ ./test_flow_dissector -i 4 -f 7
149
+ # Send 10 IPv4/UDP packets from port 9. Filter should drop all.
150
+ ./test_flow_dissector -i 4 -f 9 -F
151
+ # Send 10 IPv4/UDP packets from port 11. Filter should not drop any.
152
+ ./test_flow_dissector -i 4 -f 11
153
+
154
+ tc filter del dev lo ingress pref 1337
155
+
142
156
echo " Testing IPv6..."
143
157
# Drops all IPv6/UDP packets coming from port 9
144
158
tc filter add dev lo parent ffff: protocol ipv6 pref 1337 flower ip_proto \
You can’t perform that action at this time.
0 commit comments