From d8419a9611bf93002fd1c05eeb18d4e239fff094 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 10 Aug 2022 12:25:40 +0200 Subject: [PATCH] platform: fix logging of link removed signal The removed signal did not log the interface name. That's because _LOG3D() takes the ifindex and looks into the platform cache to find the interface name. However, if the link is already removed, it won't find it. Fix that by explicitly using the right name. Before: [1660070838.2976] platform: signal: link removed: 602: testX6 mtu 1500 Now: [1660070838.2976] platform: (testX6) signal: link removed: 602: testX6 mtu 1500 --- src/libnm-platform/nm-platform.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libnm-platform/nm-platform.c b/src/libnm-platform/nm-platform.c index 207f642c14..df177485ff 100644 --- a/src/libnm-platform/nm-platform.c +++ b/src/libnm-platform/nm-platform.c @@ -9529,9 +9529,13 @@ log_link(NMPlatform *self, { char sbuf[NM_UTILS_TO_STRING_BUFFER_SIZE]; - _LOG3D("signal: link %7s: %s", - nm_platform_signal_change_type_to_string(change_type), - nm_platform_link_to_string(device, sbuf, sizeof(sbuf))); + if (_LOGD_ENABLED()) { + NMLOG_COMMON(LOGL_DEBUG, + device->name, + "signal: link %7s: %s", + nm_platform_signal_change_type_to_string(change_type), + nm_platform_link_to_string(device, sbuf, sizeof(sbuf))); + } } static void