#include "unit.h"
-static inline int bpf_foreign_supported(void) {
- return cg_all_unified();
-}
-
/*
* Attach cgroup-bpf programs foreign to systemd, i.e. loaded to the kernel by an entity
* external to systemd.
if (r > 0)
mask |= CGROUP_MASK_BPF_DEVICES;
- /* BPF pinned prog */
- r = bpf_foreign_supported();
- if (r < 0)
- return r;
- if (r > 0)
- mask |= CGROUP_MASK_BPF_FOREIGN;
+ /* BPF pinned prog (always supported by cgroup v2) */
+ mask |= CGROUP_MASK_BPF_FOREIGN;
/* BPF-based bind{4|6} hooks */
r = bpf_socket_bind_supported();
return r;
unit_write_setting(u, flags, name, buf);
-
- if (c->bpf_foreign_programs) {
- r = bpf_foreign_supported();
- if (r < 0)
- return r;
- if (r == 0)
- log_full(LOG_DEBUG,
- "Transient unit %s configures a BPF program pinned to BPF "
- "filesystem, but the local system does not support that.\n"
- "Starting this unit will fail!", u->id);
- }
}
return 1;