Skip to content

Commit 720222a

Browse files
committed
fixup! Forbid use of SO_MARK in excluded cgroup
1 parent 69cd410 commit 720222a

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

mullvad-exclude/bpf/mullvad-exclude.cgroup-sock-create.bpf.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,5 @@ int mullvad_exclude_sock_create(struct bpf_sock *ctx) {
1717
// Forbid applications in the cgroup from setting SO_MARK and breaking split-tunneling.
1818
SEC("cgroup/setsockopt")
1919
int mullvad_exclude_deny_so_mark(struct bpf_sockopt *ctx) {
20-
if (ctx->level == SOL_SOCKET && ctx->optname == SO_MARK) {
21-
return 0; // forbid applications from setting SO_MARK
22-
}
23-
24-
return 1;
20+
return !(ctx->level == SOL_SOCKET && ctx->optname == SO_MARK);
2521
}

0 commit comments

Comments
 (0)