mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-09 00:40:19 +01:00
clients: set ipv4.dns-priority to a exclusive value (-10) when importing WireGuard profiles
This commit is contained in:
parent
9a74d2e023
commit
7b630d8dba
1 changed files with 8 additions and 0 deletions
|
|
@ -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]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue