Unverified Commit 9346110a by Stéphane Graber Committed by GitHub

Merge pull request #3196 from brauner/cgroup2_devices_fixes_2

cgroups/devices: use dedicated enums
parents 3e32a626 356e71c6
......@@ -447,7 +447,8 @@ int bpf_list_add_device(struct lxc_conf *conf, struct device_item *device)
lxc_list_for_each(it, &conf->devices) {
struct device_item *cur = it->elem;
if (cur->global_rule != -1 && device->global_rule != -1) {
if (cur->global_rule > LXC_BPF_DEVICE_CGROUP_LOCAL_RULE &&
device->global_rule > LXC_BPF_DEVICE_CGROUP_LOCAL_RULE) {
TRACE("Switched from %s to %s",
cur->global_rule == LXC_BPF_DEVICE_CGROUP_WHITELIST
? "whitelist"
......
......@@ -231,9 +231,9 @@ struct lxc_state_client {
};
enum {
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE = -1,
LXC_BPF_DEVICE_CGROUP_WHITELIST = 0,
LXC_BPF_DEVICE_CGROUP_BLACKLIST = 1,
LXC_BPF_DEVICE_CGROUP_LOCAL_RULE = -1,
};
struct device_item {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment