diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2016-02-26 13:30:56 +0100 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2016-02-26 13:37:01 +0100 |
commit | 02278d3b8f594df7471f91ff8d2736f3bad97e47 (patch) | |
tree | 6838e8f449da27cc1a31778fa8577c36b3723b07 /src/devices/nm-arping-manager.c | |
parent | aae6f07fe50f0917a55e9cf02cafe177ea654dfe (diff) | |
download | NetworkManager-02278d3b8f594df7471f91ff8d2736f3bad97e47.tar.gz |
arping-manager: failure to get a device name should not be fatal
The device could just be removed mid-flight.
Diffstat (limited to 'src/devices/nm-arping-manager.c')
-rw-r--r-- | src/devices/nm-arping-manager.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/devices/nm-arping-manager.c b/src/devices/nm-arping-manager.c index ea10609f21..dfb20b4b51 100644 --- a/src/devices/nm-arping-manager.c +++ b/src/devices/nm-arping-manager.c @@ -193,7 +193,12 @@ nm_arping_manager_start_probe (NMArpingManager *self, guint timeout, GError **er g_return_val_if_fail (priv->state == STATE_INIT, FALSE); argv[4] = nm_platform_link_get_name (NM_PLATFORM_GET, priv->ifindex); - g_return_val_if_fail (argv[4], FALSE); + if (!argv[4]) { + /* The device was probably just removed. */ + g_set_error (error, NM_DEVICE_ERROR, NM_DEVICE_ERROR_FAILED, + "can't find a name for ifindex %d", priv->ifindex); + return FALSE; + } priv->completed = 0; @@ -306,7 +311,11 @@ send_announcements (NMArpingManager *self, const char *mode_arg) AddressInfo *info; argv[4] = nm_platform_link_get_name (NM_PLATFORM_GET, priv->ifindex); - g_return_if_fail (argv[4]); + if (!argv[4]) { + /* The device was probably just removed. */ + _LOGW ("can't find a name for ifindex %d", priv->ifindex); + return; + } argv[0] = nm_utils_find_helper ("arping", NULL, NULL); if (!argv[0]) { |