bpf: beef up bpf detection, check if BPF_F_ALLOW_MULTI is supported
This improves the BPF/cgroup detection logic, and looks whether BPF_ALLOW_MULTI is supported. This flag allows execution of multiple BPF filters in a recursive fashion for a whole cgroup tree. It enables us to properly report IP accounting for slice units, as well as delegation of BPF support to units without breaking our own IP accounting.
This commit is contained in:
+6
-1
@@ -71,12 +71,17 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
r = bpf_firewall_supported();
|
||||
if (r == 0) {
|
||||
if (r == BPF_FIREWALL_UNSUPPORTED) {
|
||||
log_notice("BPF firewalling not supported, skipping");
|
||||
return EXIT_TEST_SKIP;
|
||||
}
|
||||
assert_se(r > 0);
|
||||
|
||||
if (r == BPF_FIREWALL_SUPPORTED_WITH_MULTI)
|
||||
log_notice("BPF firewalling with BPF_F_ALLOW_MULTI supported. Yay!");
|
||||
else
|
||||
log_notice("BPF firewalling (though without BPF_F_ALLOW_MULTI) supported. Good.");
|
||||
|
||||
r = bpf_program_load_kernel(p, log_buf, ELEMENTSOF(log_buf));
|
||||
assert(r >= 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user