mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-20 03:38:33 +02:00
vpn-connections: set ifname for tunelled VPN configuration
The configuration is going to be applied on the parent interface. If we didn't do this, an attempt to add a route would result in an assertion failure: nm-ip4-config.c:1475:nm_ip4_config_add_route: assertion failed: (priv->ifindex)
This commit is contained in:
parent
6e5fbf096a
commit
5c1c577c31
1 changed files with 8 additions and 1 deletions
|
|
@ -1359,6 +1359,7 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
|
|||
const char *str;
|
||||
GVariant *v;
|
||||
gboolean b;
|
||||
int ifindex;
|
||||
|
||||
g_return_if_fail (dict && g_variant_is_of_type (dict, G_VARIANT_TYPE_VARDICT));
|
||||
|
||||
|
|
@ -1386,7 +1387,13 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
|
|||
priv->has_ip6 = FALSE;
|
||||
}
|
||||
|
||||
config = nm_ip4_config_new (priv->ip_ifindex);
|
||||
if (priv->ip_ifindex > 0) {
|
||||
ifindex = priv->ip_ifindex;
|
||||
} else {
|
||||
NMDevice *parent_dev = nm_active_connection_get_device (NM_ACTIVE_CONNECTION (self));
|
||||
ifindex = nm_device_get_ip_ifindex (parent_dev);
|
||||
}
|
||||
config = nm_ip4_config_new (ifindex);
|
||||
|
||||
memset (&address, 0, sizeof (address));
|
||||
address.plen = 24;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue