vpn,dns: for interface-less VPN connections get the ip_iface from the parent device

Since 027f4c65ac, the ip_iface for
nm_dns_manager_add_ip_config() must be set.

Wit interface-less VPN types like libreswan, we thus hit the assertion
  nm_dns_manager_add_ip_config: assertion 'iface && iface[0]' failed

Fix that, by fallback to the interface name of the parent device.

Fixes: 027f4c65ac
(cherry picked from commit 3f8a60def6)
This commit is contained in:
Thomas Haller 2016-05-27 12:49:09 +02:00
parent b7b3163f39
commit 4663d3ceac
2 changed files with 2 additions and 2 deletions

View file

@ -1141,7 +1141,7 @@ _ipx_get_best_config (const VTableIP *vtable,
if (out_ac)
*out_ac = NM_ACTIVE_CONNECTION (vpn);
if (out_ip_iface)
*out_ip_iface = nm_vpn_connection_get_ip_iface (vpn, FALSE);
*out_ip_iface = nm_vpn_connection_get_ip_iface (vpn, TRUE);
} else {
NMDevice *device = entry->source.device;
NMActRequest *req;

View file

@ -1442,7 +1442,7 @@ vpn_connection_activated (NMPolicy *self, NMVpnConnection *vpn)
nm_dns_manager_begin_updates (priv->dns_manager, __func__);
ip_iface = nm_vpn_connection_get_ip_iface (vpn, FALSE);
ip_iface = nm_vpn_connection_get_ip_iface (vpn, TRUE);
/* Add the VPN connection's IP configs from DNS */