summaryrefslogtreecommitdiff
path: root/src/platform/tests
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-15 14:41:35 +0200
committerThomas Haller <thaller@redhat.com>2015-06-17 11:41:43 +0200
commit1b2b988ea95c5d7cc7d4e8bcee3ab2a325c62c52 (patch)
tree6f7e4b88f13c3f0fb814ab54e6558be8e8029f8f /src/platform/tests
parent2f4301bd261af371acad0a9ab00a786308060aa7 (diff)
downloadNetworkManager-1b2b988ea95c5d7cc7d4e8bcee3ab2a325c62c52.tar.gz
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.
Diffstat (limited to 'src/platform/tests')
-rw-r--r--src/platform/tests/dump.c2
1 files changed, 1 insertions, 1 deletions
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)