From a39fac2248bf745dc51a4e6da17ea4bb42224f6c Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 13 Apr 2017 18:28:08 +0200 Subject: [PATCH] manager: set interface as removed when the link disappears 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 (cherry picked from commit df537d2eac44cffe4512214c87f3f303c5a350d3) --- src/nm-manager.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nm-manager.c b/src/nm-manager.c index 7c0dac12b..7b9da96da 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",