summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-08-10 12:25:40 +0200
committerThomas Haller <thaller@redhat.com>2022-08-10 12:47:16 +0200
commitd8419a9611bf93002fd1c05eeb18d4e239fff094 (patch)
treec84bb064e9135758e231e3d7a1f1297bc60061e0
parent4dbded903f6925d166359b6b2f948637d647f139 (diff)
downloadNetworkManager-d8419a9611bf93002fd1c05eeb18d4e239fff094.tar.gz
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: <debug> [1660070838.2976] platform: signal: link removed: 602: testX6 <DOWN;broadcast,multicast> mtu 1500 Now: <debug> [1660070838.2976] platform: (testX6) signal: link removed: 602: testX6 <DOWN;broadcast,multicast> mtu 1500
-rw-r--r--src/libnm-platform/nm-platform.c10
1 files 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