core: fix the check if CONFIG_CGROUP_BPF is on
authorAlexander Filippov <a.filippov@yadro.com>
Mon, 17 Sep 2018 09:49:40 +0000 (12:49 +0300)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 18 Sep 2018 14:19:51 +0000 (16:19 +0200)
commit047de7e1b17ad1375502c08cc1b909f28a92bdac
tree06e88dcfb0a2aae9c83ac65997d286f9015fc021
parenteda7ed3363f1dd523e723de4ef89961fbd1ae392
core: fix the check if CONFIG_CGROUP_BPF is on

Since the commit torvalds/linux@fdb5c4531c1e0e50e609df83f736b6f3a02896e2
the syscall BPF_PROG_ATTACH return EBADF when CONFIG_CGROUP_BPF is
turned off and as result the bpf_firewall_supported() returns the
incorrect value.

This commmit replaces the syscall BPF_PROG_ATTACH with BPF_PROG_DETACH
which is still work as expected.

Resolves openbmc/linux#159
See also systemd/systemd#7054

Signed-off-by: Alexander Filippov <a.filippov@yadro.com>
src/core/bpf-firewall.c