From 10e280686e2ff5ba020717e8d3e1421ab44f0c52 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 2 Nov 2018 12:39:02 +0100 Subject: [PATCH] core: pass boot-id to nm_utils_stable_id_parse() For testing purpose, it's bad to let nm_utils_stable_id_parse() directly access nm_utils_get_boot_id_str(). Instead, the function should have no side-effects. Since the boot-id is anyway cached, accessing it is cheap. Even if it likely won't be needed. (cherry picked from commit c51e63feb698447c5d91a06e0dcc3302845af452) --- src/devices/nm-device.c | 2 +- src/nm-core-utils.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4888cc66e9..9c01ac8306 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1281,7 +1281,7 @@ _get_stable_id (NMDevice *self, stable_type = nm_utils_stable_id_parse (stable_id, nm_device_get_ip_iface (self), - NULL, + nm_utils_get_boot_id_str (), uuid, &generated); diff --git a/src/nm-core-utils.c b/src/nm-core-utils.c index 45fb4f455d..37f1bc3211 100644 --- a/src/nm-core-utils.c +++ b/src/nm-core-utils.c @@ -3165,7 +3165,7 @@ nm_utils_stable_id_parse (const char *stable_id, if (CHECK_PREFIX ("${CONNECTION}")) _stable_id_append (str, uuid); else if (CHECK_PREFIX ("${BOOT}")) - _stable_id_append (str, bootid ?: nm_utils_get_boot_id_str ()); + _stable_id_append (str, bootid); else if (CHECK_PREFIX ("${DEVICE}")) _stable_id_append (str, deviceid); else if (g_str_has_prefix (&stable_id[i], "${RANDOM}")) {