mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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:
parent
c54a504890
commit
9df59055ed
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user