From 12ac241fa0b79b329eaa2ea0fbc2317c1e62d6d5 Mon Sep 17 00:00:00 2001 From: Stanislav Fomichev Date: Mon, 22 Apr 2019 08:55:52 -0700 Subject: [PATCH] UPSTREAM: bpf/flow_dissector: don't adjust nhoff by ETH_HLEN in BPF_PROG_TEST_RUN Now that we use skb-less flow dissector let's return true nhoff and thoff. We used to adjust them by ETH_HLEN because that's how it was done in the skb case. For VLAN tests that looks confusing: nhoff is pointing to vlan parts :-\ Warning, this is an API change for BPF_PROG_TEST_RUN! Feel free to drop if you think that it's too late at this point to fix it. Change-Id: Icae82218f62c91b7860981bc62269eba8e58c25c Signed-off-by: Stanislav Fomichev Signed-off-by: Daniel Borkmann Signed-off-by: Sorayukii --- net/bpf/test_run.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index a5b031f2f003..5be430c984c1 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -421,9 +421,6 @@ int bpf_prog_test_run_flow_dissector(struct bpf_prog *prog, retval = bpf_flow_dissect(prog, &ctx, eth->h_proto, ETH_HLEN, size); - flow_keys.nhoff -= ETH_HLEN; - flow_keys.thoff -= ETH_HLEN; - if (signal_pending(current)) { preempt_enable(); rcu_read_unlock();