diff options
author | Thomas Haller <thaller@redhat.com> | 2020-04-08 13:42:00 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2020-04-08 13:47:26 +0200 |
commit | 7b630d8dba5d1363be87dba499a5852aec67da9a (patch) | |
tree | 91d8dc82d644844971ce3a2a02ba6a0d383be740 | |
parent | 9a74d2e023007deceb808d8687acc561a195f0bb (diff) | |
download | NetworkManager-7b630d8dba5d1363be87dba499a5852aec67da9a.tar.gz |
clients: set ipv4.dns-priority to a exclusive value (-10) when importing WireGuard profiles
-rw-r--r-- | clients/common/nm-vpn-helpers.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clients/common/nm-vpn-helpers.c b/clients/common/nm-vpn-helpers.c index cfdd7571ad..35ed445187 100644 --- a/clients/common/nm-vpn-helpers.c +++ b/clients/common/nm-vpn-helpers.c @@ -744,6 +744,14 @@ fail_invalid_secret: data_addr ? method_manual : method_disabled, NULL); + /* For WireGuard profiles, always set dns-priority to a negative value, + * so that DNS servers on other profiles get ignored. This is also what + * wg-quick does, by calling `resolvconf -x`. */ + g_object_set (s_ip, + NM_SETTING_IP_CONFIG_DNS_PRIORITY, + (int) -10, + NULL); + if (data_addr) { for (i = 0; i < data_addr->len; i++) nm_setting_ip_config_add_address (s_ip, data_addr->pdata[i]); |