summaryrefslogtreecommitdiff
path: root/src/core/restrict-ifaces.c
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2022-03-15 17:12:06 +0000
committerDaan De Meyer <daan.j.demeyer@gmail.com>2022-03-15 17:12:06 +0000
commit8f048bb76a350473fb81a4a100aa5aafa7d3f824 (patch)
treec689123ee2656ab21f52db0fb6ab6f68947e07fe /src/core/restrict-ifaces.c
parentd4782b51ec448ad6e26d119cb17a7576fe719760 (diff)
downloadsystemd-8f048bb76a350473fb81a4a100aa5aafa7d3f824.tar.gz
bpf: Log at debug when checking if restricting ifaces is supported
Same change as 1a9e33aee36b4c353628068507ba1dd7d76b6e14 did for socket-bind.
Diffstat (limited to 'src/core/restrict-ifaces.c')
-rw-r--r--src/core/restrict-ifaces.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/restrict-ifaces.c b/src/core/restrict-ifaces.c
index 0132c3c877..00dc429078 100644
--- a/src/core/restrict-ifaces.c
+++ b/src/core/restrict-ifaces.c
@@ -34,11 +34,12 @@ static int prepare_restrict_ifaces_bpf(
obj = restrict_ifaces_bpf__open();
if (!obj)
- return log_unit_error_errno(u, SYNTHETIC_ERRNO(ENOMEM), "Failed to open BPF object");
+ return log_unit_full_errno(u, u ? LOG_ERR : LOG_DEBUG,
+ SYNTHETIC_ERRNO(ENOMEM), "Failed to open BPF object");
r = sym_bpf_map__resize(obj->maps.sd_restrictif, MAX(set_size(restrict_network_interfaces), 1u));
if (r != 0)
- return log_unit_error_errno(u, r,
+ return log_unit_full_errno(u, u ? LOG_ERR : LOG_WARNING, r,
"Failed to resize BPF map '%s': %m",
sym_bpf_map__name(obj->maps.sd_restrictif));
@@ -46,7 +47,7 @@ static int prepare_restrict_ifaces_bpf(
r = restrict_ifaces_bpf__load(obj);
if (r != 0)
- return log_unit_error_errno(u, r, "Failed to load BPF object: %m");
+ return log_unit_full_errno(u, u ? LOG_ERR : LOG_DEBUG, r, "Failed to load BPF object: %m");
map_fd = sym_bpf_map__fd(obj->maps.sd_restrictif);
@@ -61,7 +62,9 @@ static int prepare_restrict_ifaces_bpf(
}
if (sym_bpf_map_update_elem(map_fd, &ifindex, &dummy, BPF_ANY))
- return log_unit_error_errno(u, errno, "Failed to update BPF map '%s' fd: %m", sym_bpf_map__name(obj->maps.sd_restrictif));
+ return log_unit_full_errno(u, u ? LOG_ERR : LOG_WARNING, errno,
+ "Failed to update BPF map '%s' fd: %m",
+ sym_bpf_map__name(obj->maps.sd_restrictif));
}
*ret_object = TAKE_PTR(obj);