summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/bpf_flow.c
diff options
context:
space:
mode:
authorSantucci Pierpaolo <santucci@epigenesys.com>2020-11-16 11:30:37 +0100
committerDaniel Borkmann <daniel@iogearbox.net>2020-11-16 16:23:29 +0100
commit024cd2cbd1ca2d29e6df538855d52c4e5990cab7 (patch)
tree3b53d3abd891a502c3f259b69d540e2cc4e3fcda /tools/testing/selftests/bpf/progs/bpf_flow.c
parent2d38c5802f4626e85d280b68481c3f3ca4853ecb (diff)
downloadlinux-024cd2cbd1ca2d29e6df538855d52c4e5990cab7.tar.gz
selftest/bpf: Fix IPV6FR handling in flow dissector
From second fragment on, IPV6FR program must stop the dissection of IPV6 fragmented packet. This is the same approach used for IPV4 fragmentation. This fixes the flow keys calculation for the upper-layer protocols. Note that according to RFC8200, the first fragment packet must include the upper-layer header. Signed-off-by: Santucci Pierpaolo <santucci@epigenesys.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Reviewed-by: Jakub Sitnicki <jakub@cloudflare.com> Link: https://lore.kernel.org/bpf/X7JUzUj34ceE2wBm@santucci.pierpaolo
Diffstat (limited to 'tools/testing/selftests/bpf/progs/bpf_flow.c')
-rw-r--r--tools/testing/selftests/bpf/progs/bpf_flow.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/testing/selftests/bpf/progs/bpf_flow.c b/tools/testing/selftests/bpf/progs/bpf_flow.c
index 5a65f6b51377..95a5a0778ed7 100644
--- a/tools/testing/selftests/bpf/progs/bpf_flow.c
+++ b/tools/testing/selftests/bpf/progs/bpf_flow.c
@@ -368,6 +368,8 @@ PROG(IPV6FR)(struct __sk_buff *skb)
*/
if (!(keys->flags & BPF_FLOW_DISSECTOR_F_PARSE_1ST_FRAG))
return export_flow_keys(keys, BPF_OK);
+ } else {
+ return export_flow_keys(keys, BPF_OK);
}
return parse_ipv6_proto(skb, fragh->nexthdr);