bpf: Collapse offset checks in sock_filter_is_valid_access

Make sock_filter_is_valid_access consistent with other is_valid_access
helpers.

Requested-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David Ahern <dsahern@gmail.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
David Ahern 2017-09-01 08:18:07 -07:00 committed by David S. Miller
parent c54a504890
commit 9df59055ed

View File

@ -3468,9 +3468,7 @@ static bool sock_filter_is_valid_access(int off, int size,
if (type == BPF_WRITE) {
switch (off) {
case offsetof(struct bpf_sock, bound_dev_if):
break;
case offsetof(struct bpf_sock, mark):
break;
case offsetof(struct bpf_sock, priority):
break;
default: