diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-06-08 18:19:38 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-06-08 22:02:35 +0200 |
commit | 7a7cf83dc3378d4063c728ff6a486c5edfe2f86c (patch) | |
tree | 84d7c0bb7f6e42e975daddf2f9843dc8a93897d2 /src/core/bpf-firewall.c | |
parent | bpf-program: use structured initialization when allocating BPFProgram objects (diff) | |
download | systemd-7a7cf83dc3378d4063c728ff6a486c5edfe2f86c.tar.xz systemd-7a7cf83dc3378d4063c728ff6a486c5edfe2f86c.zip |
bpf-program: export hash_ops for BPFProgam objects
Diffstat (limited to 'src/core/bpf-firewall.c')
-rw-r--r-- | src/core/bpf-firewall.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/bpf-firewall.c b/src/core/bpf-firewall.c index eda4d3bbdf..c216d51460 100644 --- a/src/core/bpf-firewall.c +++ b/src/core/bpf-firewall.c @@ -587,8 +587,6 @@ int bpf_firewall_compile(Unit *u) { return 0; } -DEFINE_PRIVATE_HASH_OPS_WITH_VALUE_DESTRUCTOR(filter_prog_hash_ops, void, trivial_hash_func, trivial_compare_func, BPFProgram, bpf_program_unref); - static int load_bpf_progs_from_fs_to_set(Unit *u, char **filter_paths, Set **set) { char **bpf_fs_path; @@ -606,7 +604,7 @@ static int load_bpf_progs_from_fs_to_set(Unit *u, char **filter_paths, Set **set if (r < 0) return log_unit_error_errno(u, r, "Loading of ingress BPF program %s failed: %m", *bpf_fs_path); - r = set_ensure_consume(set, &filter_prog_hash_ops, TAKE_PTR(prog)); + r = set_ensure_consume(set, &bpf_program_hash_ops, TAKE_PTR(prog)); if (r < 0) return log_unit_error_errno(u, r, "Can't add program to BPF program set: %m"); } @@ -658,7 +656,7 @@ static int attach_custom_bpf_progs(Unit *u, const char *path, int attach_type, S return log_unit_error_errno(u, r, "Attaching custom egress BPF program to cgroup %s failed: %m", path); /* Remember that these BPF programs are installed now. */ - r = set_ensure_put(set_installed, &filter_prog_hash_ops, prog); + r = set_ensure_put(set_installed, &bpf_program_hash_ops, prog); if (r < 0) return log_unit_error_errno(u, r, "Can't add program to BPF program set: %m"); |