diff options
author | Dan Winship <danw@gnome.org> | 2013-12-17 16:57:47 -0500 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2013-12-20 09:28:01 -0500 |
commit | f2413ae498fd80ad2d200b94f7b6ad9827d72615 (patch) | |
tree | 2db976b9edc179774155c4c7254f5acd3068bfd4 | |
parent | 20b43802e88ac06d7dd2b5cc82fc43a4fe829fb8 (diff) | |
download | NetworkManager-f2413ae498fd80ad2d200b94f7b6ad9827d72615.tar.gz |
devices: don't try to capture resolv.conf if not managing it (rh #1035861)
If NM is not explicitly managing resolv.conf (either due to the "dns"
NetworkManager.conf setting, or because resolv.conf is immutable),
then don't try to parse nameservers out of it when capturing a
connection, since there's no reason to believe that the name servers
there are related to any particular connection.
-rw-r--r-- | src/devices/nm-device.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index f8caf5a8cb..21d5f94dcd 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -68,6 +68,7 @@ #include "nm-config-device.h" #include "nm-config.h" #include "nm-platform.h" +#include "nm-dns-manager.h" #include "nm-device-bridge.h" #include "nm-device-bond.h" @@ -6584,14 +6585,19 @@ update_ip_config (NMDevice *self, gboolean initial) NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self); int ifindex; gboolean linklocal6_just_completed = FALSE; + gboolean capture_resolv_conf; + NMDnsManagerResolvConfMode resolv_conf_mode; ifindex = nm_device_get_ip_ifindex (self); if (!ifindex) return; + resolv_conf_mode = nm_dns_manager_get_resolv_conf_mode (nm_dns_manager_get ()); + capture_resolv_conf = initial && (resolv_conf_mode == NM_DNS_MANAGER_RESOLV_CONF_EXPLICIT); + /* IPv4 */ g_clear_object (&priv->ext_ip4_config); - priv->ext_ip4_config = nm_ip4_config_capture (ifindex, initial); + priv->ext_ip4_config = nm_ip4_config_capture (ifindex, capture_resolv_conf); if (priv->ext_ip4_config) { if (initial) { @@ -6608,7 +6614,7 @@ update_ip_config (NMDevice *self, gboolean initial) /* IPv6 */ g_clear_object (&priv->ext_ip6_config); - priv->ext_ip6_config = nm_ip6_config_capture (ifindex, initial); + priv->ext_ip6_config = nm_ip6_config_capture (ifindex, capture_resolv_conf); if (priv->ext_ip6_config) { /* Check this before modifying ext_ip6_config */ |