summaryrefslogtreecommitdiffstats
path: root/src/test/test-bpf-firewall.c
diff options
context:
space:
mode:
authoralexlzhu <alexlzhu@fb.com>2021-08-19 01:01:05 +0200
committerLennart Poettering <lennart@poettering.net>2021-10-12 12:48:23 +0200
commit76dc17254f7c78eae2dec2b9b1cfb60657a7b6e7 (patch)
treeeaf61330174b3b5b5647cd11ec6951f5d1609220 /src/test/test-bpf-firewall.c
parentnetwork: dhcp6-pd: also assign addresses in IA_PD prefixes on uplink interface (diff)
downloadsystemd-76dc17254f7c78eae2dec2b9b1cfb60657a7b6e7.tar.xz
systemd-76dc17254f7c78eae2dec2b9b1cfb60657a7b6e7.zip
core: remove refcount for bpf program
Currently ref count of bpf-program is kept in user space. However, the kernel already implements its own ref count. Thus the ref count we keep for bpf-program is redundant. This PR removes ref count for bpf program as part of a task to simplify bpf-program and remove redundancies, which will make the switch to code-compiled BPF programs easier. Part of #19270
Diffstat (limited to 'src/test/test-bpf-firewall.c')
-rw-r--r--src/test/test-bpf-firewall.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/test/test-bpf-firewall.c b/src/test/test-bpf-firewall.c
index 732350fae4..2e19db600e 100644
--- a/src/test/test-bpf-firewall.c
+++ b/src/test/test-bpf-firewall.c
@@ -24,7 +24,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;
+ _cleanup_(bpf_program_freep) BPFProgram *p = NULL;
_cleanup_(manager_freep) Manager *m = NULL;
Unit *u;
char log_buf[65535];
@@ -93,7 +93,7 @@ int main(int argc, char *argv[]) {
}
}
- p = bpf_program_unref(p);
+ p = bpf_program_free(p);
/* The simple tests succeeded. Now let's try full unit-based use-case. */