bpf: Collapse offset checks in sock_filter_is_valid_access
authorDavid Ahern <dsahern@gmail.com>
Fri, 1 Sep 2017 15:18:07 +0000 (08:18 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 1 Sep 2017 17:37:14 +0000 (10:37 -0700)
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>
net/core/filter.c

index 9dad3e7..f9add02 100644 (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: