vpn-connection: set the MTU for the VPN IP interface

The 9b79e6c73 commit moved setting of the MTU from IP4Config to NMDevice, but
VPN connections don't have a NMDevice instance (yet). Set the MTU also from the
VPN connection. Also, copying of the MTU to the IP4Config is no longer needed
as the ip4_config_commit no longer sets the MTU.

Fixes: 9b79e6c732

https://bugzilla.gnome.org/show_bug.cgi?id=754781
This commit is contained in:
Lubomir Rintel 2015-09-28 20:57:09 +02:00
parent 8b0bb7a022
commit e0fa48f224

View file

@ -1069,6 +1069,9 @@ nm_vpn_connection_apply_config (NMVpnConnection *self)
TRUE))
return FALSE;
}
if (priv->mtu && priv->mtu != nm_platform_link_get_mtu (NM_PLATFORM_GET, priv->ip_ifindex))
nm_platform_link_set_mtu (NM_PLATFORM_GET, priv->ip_ifindex, priv->mtu);
}
apply_parent_device_config (self);
@ -1258,10 +1261,6 @@ process_generic_config (NMVpnConnection *self, GVariant *dict)
return FALSE;
}
/* MTU; this is a per-connection value, though NM's API treats it
* like it's IP4-specific. So we store it for now and retrieve it
* later in ip4_config_get.
*/
priv->mtu = 0;
if (g_variant_lookup (dict, NM_VPN_PLUGIN_CONFIG_EXT_GATEWAY, "u", &u32))
priv->mtu = u32;
@ -1404,9 +1403,6 @@ nm_vpn_connection_ip4_config_get (NMVpnConnection *self, GVariant *dict)
if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_MSS, "u", &u32))
nm_ip4_config_set_mss (config, u32);
if (priv->mtu)
nm_ip4_config_set_mtu (config, priv->mtu, NM_IP_CONFIG_SOURCE_VPN);
if (g_variant_lookup (dict, NM_VPN_PLUGIN_IP4_CONFIG_DOMAIN, "&s", &str))
nm_ip4_config_add_domain (config, str);