summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2022-01-16 20:19:19 +0900
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-01-18 12:18:46 +0100
commit9f43dde134b6ee0290259ba302ec0149822690fc (patch)
treea9660ddc8071de2b6803adf4d7a8370ef504287c
parent0874eaefa30555a28f9f15cfc8a909afa07f01a7 (diff)
downloadsystemd-9f43dde134b6ee0290259ba302ec0149822690fc.tar.gz
core: update log message
Fixes CID#1469009. (cherry picked from commit cc8943b84ad5ffb6d327404ff577d9d185a5c316)
-rw-r--r--src/core/restrict-ifaces.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/core/restrict-ifaces.c b/src/core/restrict-ifaces.c
index 7650031434..0132c3c877 100644
--- a/src/core/restrict-ifaces.c
+++ b/src/core/restrict-ifaces.c
@@ -19,9 +19,12 @@ static struct restrict_ifaces_bpf *restrict_ifaces_bpf_free(struct restrict_ifac
DEFINE_TRIVIAL_CLEANUP_FUNC(struct restrict_ifaces_bpf *, restrict_ifaces_bpf_free);
-static int prepare_restrict_ifaces_bpf(Unit* u, bool is_allow_list,
+static int prepare_restrict_ifaces_bpf(
+ Unit* u,
+ bool is_allow_list,
const Set *restrict_network_interfaces,
struct restrict_ifaces_bpf **ret_object) {
+
_cleanup_(restrict_ifaces_bpf_freep) struct restrict_ifaces_bpf *obj = NULL;
_cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
char *iface;
@@ -50,9 +53,10 @@ static int prepare_restrict_ifaces_bpf(Unit* u, bool is_allow_list,
SET_FOREACH(iface, restrict_network_interfaces) {
uint8_t dummy = 0;
int ifindex;
+
ifindex = rtnl_resolve_interface(&rtnl, iface);
if (ifindex < 0) {
- log_unit_warning_errno(u, ifindex, "Couldn't find index of network interface: %m. Ignoring '%s'", iface);
+ log_unit_warning_errno(u, ifindex, "Couldn't find index of network interface '%s', ignoring: %m", iface);
continue;
}