summaryrefslogtreecommitdiff
path: root/src/test/test-bpf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/test-bpf.c')
-rw-r--r--src/test/test-bpf.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/test/test-bpf.c b/src/test/test-bpf.c
index 6ca2be41b0..4d89bd46d3 100644
--- a/src/test/test-bpf.c
+++ b/src/test/test-bpf.c
@@ -1,22 +1,4 @@
/* SPDX-License-Identifier: LGPL-2.1+ */
-/***
- This file is part of systemd.
-
- Copyright 2016 Daniel Mack
-
- systemd is free software; you can redistribute it and/or modify it
- under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation; either version 2.1 of the License, or
- (at your option) any later version.
-
- systemd is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with systemd; If not, see <http://www.gnu.org/licenses/>.
-***/
#include <linux/libbpf.h>
#include <string.h>
@@ -41,7 +23,7 @@ int main(int argc, char *argv[]) {
_cleanup_(rm_rf_physical_and_freep) char *runtime_dir = NULL;
CGroupContext *cc = NULL;
_cleanup_(bpf_program_unrefp) BPFProgram *p = NULL;
- Manager *m = NULL;
+ _cleanup_(manager_freep) Manager *m = NULL;
Unit *u;
char log_buf[65535];
int r;
@@ -128,11 +110,9 @@ int main(int argc, char *argv[]) {
unit_dump(u, stdout, NULL);
r = bpf_firewall_compile(u);
- if (IN_SET(r, -ENOTTY, -ENOSYS, -EPERM )) {
+ if (IN_SET(r, -ENOTTY, -ENOSYS, -EPERM ))
/* Kernel doesn't support the necessary bpf bits, or masked out via seccomp? */
- manager_free(m);
return EXIT_TEST_SKIP;
- }
assert_se(r >= 0);
assert(u->ip_bpf_ingress);
@@ -167,7 +147,5 @@ int main(int argc, char *argv[]) {
assert_se(SERVICE(u)->exec_command[SERVICE_EXEC_START]->command_next->exec_status.code != CLD_EXITED ||
SERVICE(u)->exec_command[SERVICE_EXEC_START]->command_next->exec_status.status != EXIT_SUCCESS);
- manager_free(m);
-
return 0;
}