From 1b2b988ea95c5d7cc7d4e8bcee3ab2a325c62c52 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 15 Jun 2015 14:41:35 +0200 Subject: platform: no longer expose udi field in NMPlatformLink The @udi field is not a static string, so any user of a NMPlatformLink instance must make sure not to use the field beyond the lifetime of the NMPlatformLink instance. As we pass on the platform link instance during platform changed events, this is hard to ensure for the subscriber of the signal -- because a call back into platform could invalidate/modify the object. Just not expose this field as part of the link instance. The few callers who actually needed it should instead call nm_platform_get_uid(). With that, the lifetime of the returned 'const char *' pointer is clearly defined. --- src/platform/tests/dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/platform/tests') diff --git a/src/platform/tests/dump.c b/src/platform/tests/dump.c index 5187d266f6..575ce6fb34 100644 --- a/src/platform/tests/dump.c +++ b/src/platform/tests/dump.c @@ -44,7 +44,7 @@ dump_interface (NMPlatformLink *link) printf ("\n"); if (link->driver) printf (" driver: %s\n", link->driver); - printf (" UDI: %s\n", link->udi); + printf (" UDI: %s\n", nm_platform_link_get_udi (NM_PLATFORM_GET, link->ifindex)); if (!nm_platform_vlan_get_info (NM_PLATFORM_GET, link->ifindex, &vlan_parent, &vlan_id)) g_assert_not_reached (); if (vlan_parent) -- cgit v1.2.1