summaryrefslogtreecommitdiffstats
path: root/src/core/bpf-socket-bind.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:19:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 02:19:38 +0000
commit68aafb2658b298c23ed1725b69f5474bee5ee38c (patch)
treec383770976489dbeeef85ef7bc668da64a242b14 /src/core/bpf-socket-bind.c
parentAdding upstream version 252.23. (diff)
downloadsystemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.tar.xz
systemd-68aafb2658b298c23ed1725b69f5474bee5ee38c.zip
Adding upstream version 252.25.upstream/252.25
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/core/bpf-socket-bind.c')
-rw-r--r--src/core/bpf-socket-bind.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/bpf-socket-bind.c b/src/core/bpf-socket-bind.c
index 660ffdb..0a7ed95 100644
--- a/src/core/bpf-socket-bind.c
+++ b/src/core/bpf-socket-bind.c
@@ -32,6 +32,15 @@ static int update_rules_map(
assert(map_fd >= 0);
+ if (!head) {
+ static const struct socket_bind_rule val = {
+ .address_family = SOCKET_BIND_RULE_AF_MATCH_NOTHING,
+ };
+
+ if (sym_bpf_map_update_elem(map_fd, &i, &val, BPF_ANY) != 0)
+ return -errno;
+ }
+
LIST_FOREACH(socket_bind_items, item, head) {
struct socket_bind_rule val = {
.address_family = (uint32_t) item->address_family,