diff options
author | Thomas Haller <thaller@redhat.com> | 2016-05-09 17:21:41 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2016-05-30 16:32:07 +0200 |
commit | 6fd1bf07499cea02de050f3d3906547090f4589d (patch) | |
tree | d58fc80e9720862873509d6aa2247a646765a020 | |
parent | 6732e2a18b0056b684df8c4a573daccf981a7890 (diff) | |
download | NetworkManager-6fd1bf07499cea02de050f3d3906547090f4589d.tar.gz |
device: accept failure to lookup link in get_ip_iface_identifier()lr/connection-token
An assertion seems a bit harsh, especially, because the platform
cache cannot be always in sync with the device state.
-rw-r--r-- | src/devices/nm-device.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4ddd8231e3..5234d24cdd 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -741,10 +741,12 @@ get_ip_iface_identifier (NMDevice *self, NMUtilsIPv6IfaceId *out_iid) /* If we get here, we *must* have a kernel netdev, which implies an ifindex */ ifindex = nm_device_get_ip_ifindex (self); - g_assert (ifindex); + g_return_val_if_fail (ifindex > 0, FALSE); pllink = nm_platform_link_get (NM_PLATFORM_GET, ifindex); - g_return_val_if_fail (pllink && pllink->type > NM_LINK_TYPE_UNKNOWN, 0); + if ( !pllink + || NM_IN_SET (pllink->type, NM_LINK_TYPE_NONE, NM_LINK_TYPE_UNKNOWN)) + return FALSE; if (pllink->addr.len <= 0) return FALSE; |