bpf: Collapse offset checks in sock_filter_is_valid_access
authorDavid Ahern <[email protected]>
Fri, 1 Sep 2017 15:18:07 +0000 (08:18 -0700)
committerDavid S. Miller <[email protected]>
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 <[email protected]>
Signed-off-by: David Ahern <[email protected]>
Acked-by: Daniel Borkmann <[email protected]>
Acked-by: Alexei Starovoitov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
net/core/filter.c

index 9dad3e7e2e101819248c31317c6ca772586317e3..f9add024d92fcec8fb6dacce0a2251336204158b 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: