aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/flow_dissector.c
diff options
context:
space:
mode:
authorStanislav Fomichev <sdf@google.com>2018-12-05 20:40:47 -0800
committerAlexei Starovoitov <ast@kernel.org>2018-12-07 13:38:12 -0800
commit13e56ec2cc9860aa22e01ffc7a3160f35a96b728 (patch)
tree5dac8dfa52ee1037a7c9518618bc619dcb724a64 /net/core/flow_dissector.c
parentipv6: sr: properly initialize flowi6 prior passing to ip6_route_output (diff)
downloadlinux-dev-13e56ec2cc9860aa22e01ffc7a3160f35a96b728.tar.xz
linux-dev-13e56ec2cc9860aa22e01ffc7a3160f35a96b728.zip
selftests/bpf: use thoff instead of nhoff in BPF flow dissector
We are returning thoff from the flow dissector, not the nhoff. Pass thoff along with nhoff to the bpf program (initially thoff == nhoff) and expect flow dissector amend/return thoff, not nhoff. This avoids confusion, when by the time bpf flow dissector exits, nhoff == thoff, which doesn't make much sense. Signed-off-by: Stanislav Fomichev <sdf@google.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/core/flow_dissector.c')
-rw-r--r--net/core/flow_dissector.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/core/flow_dissector.c b/net/core/flow_dissector.c
index 588f475019d4..ff5556d80570 100644
--- a/net/core/flow_dissector.c
+++ b/net/core/flow_dissector.c
@@ -783,6 +783,7 @@ bool __skb_flow_dissect(const struct sk_buff *skb,
/* Pass parameters to the BPF program */
cb->qdisc_cb.flow_keys = &flow_keys;
flow_keys.nhoff = nhoff;
+ flow_keys.thoff = nhoff;
bpf_compute_data_pointers((struct sk_buff *)skb);
result = BPF_PROG_RUN(attached, skb);