diff options
author | Thomas Haller <thaller@redhat.com> | 2015-06-15 14:41:35 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-06-17 11:41:43 +0200 |
commit | 1b2b988ea95c5d7cc7d4e8bcee3ab2a325c62c52 (patch) | |
tree | 6f7e4b88f13c3f0fb814ab54e6558be8e8029f8f /src/platform/tests | |
parent | 2f4301bd261af371acad0a9ab00a786308060aa7 (diff) | |
download | NetworkManager-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.c | 2 |
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) |