summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-04-13 18:28:08 +0200
committerBeniamino Galvani <bgalvani@redhat.com>2017-04-13 18:54:58 +0200
commit5d23b009e669c7395f5ffaab52f3913b9b2aade0 (patch)
treee6c87dbcdb2c81b1050faab9601621f44e275099
parent67d144dd1e538cc753cbb581927f4b101726f271 (diff)
downloadNetworkManager-bg/rh1436602.tar.gz
manager: set interface as removed when the link disappearsbg/rh1436602
Set the device state as removed when the link disappears, so that in the call to unrealize() when the device is unmanaged we also perform a cleanup of it and especially, we terminate any DHCP client instances running on the device. If we keep DHCP clients running, we can hit assertions later when we start another instance on the same interface, because we kill the old dhclient from the pidfile, and the g_child_watch_add() done by the first client instance is not able to waitpid() it, complaining with: GChildWatchSource: Exit status of a child process was requested but ECHILD was received by waitpid(). Most likely the process is ignoring SIGCHLD, or some other thread is invoking waitpid() with a nonpositive first argument; either behavior can break applications that use g_child_watch_add()/g_spawn_sync() either directly or indirectly. https://bugzilla.redhat.com/show_bug.cgi?id=1436602
-rw-r--r--src/nm-manager.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nm-manager.c b/src/nm-manager.c
index 7c0dac12b3..7b9da96da3 100644
--- a/src/nm-manager.c
+++ b/src/nm-manager.c
@@ -2355,6 +2355,7 @@ _platform_link_cb_idle (PlatformLinkCbData *data)
device = nm_manager_get_device_by_ifindex (self, data->ifindex);
if (device) {
if (nm_device_is_software (device)) {
+ nm_device_sys_iface_state_set (device, NM_DEVICE_SYS_IFACE_STATE_REMOVED);
/* Our software devices stick around until their connection is removed */
if (!nm_device_unrealize (device, FALSE, &error)) {
_LOGW (LOGD_DEVICE, "(%s): failed to unrealize: %s",