From bcadcc173a7c1ddc0fc013c479445eb7d637cd5a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Wed, 17 May 2023 10:25:41 +0200 Subject: [PATCH] core: improve logging of used IPv6 interface identifier --- src/core/devices/nm-device.c | 6 +++++- src/core/nm-l3-ipv6ll.c | 8 ++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index 516fc657a0..85bc1714a5 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -11869,7 +11869,11 @@ _dev_ipac6_start(NMDevice *self) } if (nm_device_get_ip_iface_identifier(self, &iid, FALSE, &is_token)) { - _LOGD_ipac6("using the device EUI-64 identifier"); + char buf[INET6_ADDRSTRLEN]; + + _LOGD_ipac6("using the device EUI-64 identifier %s (from %s)", + nm_utils_inet6_interface_identifier_to_token(&iid, buf), + is_token ? "token" : "address"); nm_ndisc_set_iid(priv->ipac6_data.ndisc, iid, is_token); } else { /* Don't abort the addrconf at this point -- if ndisc needs the iid diff --git a/src/core/nm-l3-ipv6ll.c b/src/core/nm-l3-ipv6ll.c index 9becd07caf..38aa98fc93 100644 --- a/src/core/nm-l3-ipv6ll.c +++ b/src/core/nm-l3-ipv6ll.c @@ -665,17 +665,13 @@ _nm_l3_ipv6ll_new(NML3Cfg *l3cfg, }; if (self->addrgen.stable_type == NM_UTILS_STABLE_TYPE_NONE) { - char sbuf_token[sizeof(self->addrgen.token.iid) * 3]; + char sbuf_token[INET6_ADDRSTRLEN]; self->addrgen.token.iid = *token_iid; _LOGT("created: l3cfg=" NM_HASH_OBFUSCATE_PTR_FMT ", ifindex=%d, token=%s%s", NM_HASH_OBFUSCATE_PTR(l3cfg), nm_l3cfg_get_ifindex(l3cfg), - nm_utils_bin2hexstr_full(&self->addrgen.token.iid, - sizeof(self->addrgen.token.iid), - ':', - FALSE, - sbuf_token), + nm_utils_inet6_interface_identifier_to_token(&self->addrgen.token.iid, sbuf_token), self->assume ? ", assume" : ""); } else { self->addrgen.stable_privacy.ifname = g_strdup(ifname);