flow_dissector: fix clamping of BPF flow_keys for non-zero nhoff
authorStanislav Fomichev <sdf@google.com>
Mon, 1 Apr 2019 20:57:32 +0000 (13:57 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 3 Apr 2019 14:49:48 +0000 (16:49 +0200)
commitb9e9c8599f0f23e3d2051befc9966a84b639f64f
treeb602fe9bf2d1826282b3a9467d401d41d3ae5c61
parent822fe61795018265ae14731d4e5399e5bde36864
flow_dissector: fix clamping of BPF flow_keys for non-zero nhoff

Don't allow BPF program to set flow_keys->nhoff to less than initial
value. We currently don't read the value afterwards in anything but
the tests, but it's still a good practice to return consistent
values to the test programs.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
net/core/flow_dissector.c