summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2015-09-28 20:57:09 +0200
committerLubomir Rintel <lkundrak@v3.sk>2015-09-29 18:24:48 +0200
commite0fa48f224abcb73a1a129f10050f7cd942ee629 (patch)
treec9fdd2fda5a133c3fa3f4e742fb776078ebe1b0e
parent8b0bb7a02219b5d1c10ebc8c48a2e7f0878be4d5 (diff)
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: 9b79e6c732ffb2fb105647c1465070d36a6cc180 https://bugzilla.gnome.org/show_bug.cgi?id=754781
-rw-r--r--src/vpn-manager/nm-vpn-connection.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/vpn-manager/nm-vpn-connection.c b/src/vpn-manager/nm-vpn-connection.c
index a520dfd43e..c3f4bea458 100644
--- a/src/vpn-manager/nm-vpn-connection.c
+++ b/src/vpn-manager/nm-vpn-connection.c
@@ -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);