core: fix DNS configuration type for wireguard connections

The DNS configuration for a wireguard connection should be added with
type "VPN".

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1102
(cherry picked from commit 413e522867)
This commit is contained in:
Beniamino Galvani
2022-02-16 13:50:09 +01:00
parent 6d7b978c65
commit 8ea82f68fb

View File

@@ -2005,7 +2005,8 @@ device_state_changed(NMDevice *device,
AF_UNSPEC,
device,
nm_device_get_l3cd(device, TRUE),
NM_DNS_IP_CONFIG_TYPE_DEFAULT,
nm_device_is_vpn(device) ? NM_DNS_IP_CONFIG_TYPE_VPN
: NM_DNS_IP_CONFIG_TYPE_DEFAULT,
TRUE);
}
update_ip_dns(self, AF_INET, device);
@@ -2147,7 +2148,8 @@ device_l3cd_changed(NMDevice *device,
AF_UNSPEC,
device,
l3cd_new,
NM_DNS_IP_CONFIG_TYPE_DEFAULT,
nm_device_is_vpn(device) ? NM_DNS_IP_CONFIG_TYPE_VPN
: NM_DNS_IP_CONFIG_TYPE_DEFAULT,
TRUE);
update_ip_dns(self, AF_INET, device);
update_ip_dns(self, AF_INET6, device);