mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-14 20:18:39 +00:00
nm-device: move device MTU setting from IP4Config to NMDevice
Just a refactoring, no functional change. This will make it easier to coordinate the device MTU with IPv6 MTU.
This commit is contained in:
parent
4d6bf4eef3
commit
1bc202af02
|
@ -4079,6 +4079,14 @@ print_support_extended_ifa_flags (NMSettingIP6ConfigPrivacy use_tempaddr)
|
|||
warn = 2;
|
||||
}
|
||||
|
||||
static void
|
||||
nm_device_set_mtu (NMDevice *self, guint32 mtu)
|
||||
{
|
||||
/* MTU */
|
||||
if (mtu && mtu != nm_platform_link_get_mtu (ifindex))
|
||||
nm_platform_link_set_mtu (ifindex, mtu);
|
||||
}
|
||||
|
||||
static void
|
||||
nm_device_ipv6_set_mtu (NMDevice *self, guint32 mtu)
|
||||
{
|
||||
|
@ -5928,6 +5936,8 @@ nm_device_set_ip4_config (NMDevice *self,
|
|||
if (commit && new_config) {
|
||||
gboolean assumed = nm_device_uses_assumed_connection (self);
|
||||
|
||||
nm_device_set_mtu (self, nm_ip4_config_get_mtu (new_config));
|
||||
|
||||
/* for assumed devices we set the device_route_metric to the default which will
|
||||
* stop nm_platform_ip4_address_sync() to replace the device routes. */
|
||||
success = nm_ip4_config_commit (new_config, ip_ifindex,
|
||||
|
|
|
@ -264,7 +264,6 @@ gboolean
|
|||
nm_ip4_config_commit (const NMIP4Config *config, int ifindex, guint32 default_route_metric)
|
||||
{
|
||||
NMIP4ConfigPrivate *priv = NM_IP4_CONFIG_GET_PRIVATE (config);
|
||||
guint32 mtu = nm_ip4_config_get_mtu (config);
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (ifindex > 0, FALSE);
|
||||
|
@ -299,10 +298,6 @@ nm_ip4_config_commit (const NMIP4Config *config, int ifindex, guint32 default_ro
|
|||
return FALSE;
|
||||
}
|
||||
|
||||
/* MTU */
|
||||
if (mtu && mtu != nm_platform_link_get_mtu (ifindex))
|
||||
nm_platform_link_set_mtu (ifindex, mtu);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue