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
This commit is contained in:
Thomas Haller 2022-08-10 12:25:40 +02:00
parent 4dbded903f
commit d8419a9611
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -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