diff options
| author | Michael Biebl <biebl@debian.org> | 2017-01-23 23:34:56 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-01-23 23:34:56 +0100 |
| commit | d462f64d6044349b0a4e3581cf2c97bbab7aec97 (patch) | |
| tree | 0743acb1a191ce83b5722d77aeb896c6c0cdd952 /src/devices/nm-device-vlan.c | |
| parent | 58f8be580039b0575b197b9573a1c92745d96d30 (diff) | |
New upstream version 1.5.91 upstream/1.5.91
Diffstat (limited to 'src/devices/nm-device-vlan.c')
| -rw-r--r-- | src/devices/nm-device-vlan.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c index 3979c95d..45d7cf67 100644 --- a/src/devices/nm-device-vlan.c +++ b/src/devices/nm-device-vlan.c @@ -572,6 +572,24 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason) return ret; } +static guint32 +get_configured_mtu (NMDevice *self, gboolean *out_is_user_config) +{ + guint32 mtu = 0; + int ifindex; + + mtu = nm_device_get_configured_mtu_for_wired (self, out_is_user_config); + if (*out_is_user_config) + return mtu; + + /* Inherit the MTU from parent device, if any */ + ifindex = nm_device_parent_get_ifindex (self); + if (ifindex > 0) + mtu = nm_platform_link_get_mtu (NM_PLATFORM_GET, ifindex); + + return mtu ?: NM_DEVICE_DEFAULT_MTU_WIRED; +} + /*****************************************************************************/ static void @@ -612,7 +630,7 @@ nm_device_vlan_class_init (NMDeviceVlanClass *klass) parent_class->unrealize_notify = unrealize_notify; parent_class->get_generic_capabilities = get_generic_capabilities; parent_class->act_stage1_prepare = act_stage1_prepare; - parent_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired; + parent_class->get_configured_mtu = get_configured_mtu; parent_class->is_available = is_available; parent_class->parent_changed_notify = parent_changed_notify; |