summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-07-20 16:11:25 +0200
committerThomas Haller <thaller@redhat.com>2020-07-20 16:11:48 +0200
commit6f29ed9f3f12062fcdf8c37a1177eb13dcda99e5 (patch)
tree8ded6ad0e88409e9c7dd60a3cb43d525cd4ee5e1
parentcb4fb0ac06adf0f543fcf4555f16070e77a08b0d (diff)
downloadNetworkManager-6f29ed9f3f12062fcdf8c37a1177eb13dcda99e5.tar.gz
device: fix setting %NULL iface in nm_device_update_from_platform_link()
Fixes: f004e7b1a720 ('device: mark ifindex/iface fields of NMDevicePrivate as const')
-rw-r--r--src/devices/nm-device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index 22c255ecf6..90ca3eddd5 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -4717,8 +4717,9 @@ nm_device_update_from_platform_link (NMDevice *self, const NMPlatformLink *plink
_notify (self, PROP_PATH);
}
- str = plink ? plink->name : NULL;
- if (nm_utils_strdup_reset (&priv->iface_, str))
+ if ( plink
+ && !nm_str_is_empty (plink->name)
+ && nm_utils_strdup_reset (&priv->iface_, plink->name))
_notify (self, PROP_IFACE);
str = plink ? plink->driver : NULL;