diff options
author | Dan Williams <dcbw@redhat.com> | 2015-01-14 16:30:39 -0600 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2015-03-27 16:17:10 -0500 |
commit | 452c224656ca6129d4ae34eee86e6ecea02fa8c2 (patch) | |
tree | d34c6890776c8d95edb93204d85ce17379042c59 | |
parent | d997cde995ecf8b75ac46f3c63abd13956262782 (diff) | |
download | NetworkManager-452c224656ca6129d4ae34eee86e6ecea02fa8c2.tar.gz |
dns: kill plugin child synchronously to avoid restart race (rh #1161232) (bgo #728342)
NM was killing the dnsmasq local caching nameserver process and immediately
starting a new one, and new process couldn't bind to 127.0.0.1 because the
old one hadn't quit yet. Thus the new process quit, and the user was
left with no split DNS at all.
While this does introduce more synchronous waiting into the connection
process, it's not that much time and NM will kill dnsmasq if it hasn't
quit after 1 second. The longer-term fix is to use dnsmasq's D-Bus
interface to update DNS without respawning it.
https://bugzilla.gnome.org/show_bug.cgi?id=728342
https://bugzilla.redhat.com/show_bug.cgi?id=1161232
-rw-r--r-- | src/dns-manager/nm-dns-plugin.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/dns-manager/nm-dns-plugin.c b/src/dns-manager/nm-dns-plugin.c index 3d593cce8d..5b95d1c50a 100644 --- a/src/dns-manager/nm-dns-plugin.c +++ b/src/dns-manager/nm-dns-plugin.c @@ -183,7 +183,8 @@ nm_dns_plugin_child_spawn (NMDnsPlugin *self, return priv->pid; } -gboolean nm_dns_plugin_child_kill (NMDnsPlugin *self) +gboolean +nm_dns_plugin_child_kill (NMDnsPlugin *self) { NMDnsPluginPrivate *priv = NM_DNS_PLUGIN_GET_PRIVATE (self); @@ -193,7 +194,7 @@ gboolean nm_dns_plugin_child_kill (NMDnsPlugin *self) } if (priv->pid) { - nm_utils_kill_child_async (priv->pid, SIGTERM, LOGD_DNS, priv->progname, 2000, NULL, NULL); + nm_utils_kill_child_sync (priv->pid, SIGTERM, LOGD_DNS, priv->progname, NULL, 1000, 0); priv->pid = 0; g_free (priv->progname); priv->progname = NULL; |