selftests/bpf: Add a specific dst port matching
After this patch: #102/1 flow_dissector_classification/ipv4:OK #102/2 flow_dissector_classification/ipv4_continue_dissect:OK #102/3 flow_dissector_classification/ipip:OK #102/4 flow_dissector_classification/gre:OK #102/5 flow_dissector_classification/port_range:OK #102/6 flow_dissector_classification/ipv6:OK #102 flow_dissector_classification:OK Summary: 1/6 PASSED, 0 SKIPPED, 0 FAILED Cc: Daniel Borkmann <daniel@iogearbox.net> Cc: Andrii Nakryiko <andrii@kernel.org> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Link: https://patch.msgid.link/20250218043210.732959-5-xiyou.wangcong@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
69ab34f705
commit
15de6ba95d
1 changed files with 6 additions and 1 deletions
|
@ -542,8 +542,12 @@ static void detach_program(struct bpf_flow *skel, int prog_fd)
|
|||
|
||||
static int set_port_drop(int pf, bool multi_port)
|
||||
{
|
||||
char dst_port[16];
|
||||
|
||||
snprintf(dst_port, sizeof(dst_port), "%d", CFG_PORT_INNER);
|
||||
|
||||
SYS(fail, "tc qdisc add dev lo ingress");
|
||||
SYS(fail_delete_qdisc, "tc filter add %s %s %s %s %s %s %s %s %s %s",
|
||||
SYS(fail_delete_qdisc, "tc filter add %s %s %s %s %s %s %s %s %s %s %s %s",
|
||||
"dev lo",
|
||||
"parent FFFF:",
|
||||
"protocol", pf == PF_INET6 ? "ipv6" : "ip",
|
||||
|
@ -551,6 +555,7 @@ static int set_port_drop(int pf, bool multi_port)
|
|||
"flower",
|
||||
"ip_proto udp",
|
||||
"src_port", multi_port ? "8-10" : "9",
|
||||
"dst_port", dst_port,
|
||||
"action drop");
|
||||
return 0;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue