diff --git a/SOURCES/0029-vlan-use-parent-interface-mtu-as-default.patch b/SOURCES/0029-vlan-use-parent-interface-mtu-as-default.patch new file mode 100644 index 0000000..c3abb6f --- /dev/null +++ b/SOURCES/0029-vlan-use-parent-interface-mtu-as-default.patch @@ -0,0 +1,63 @@ +From 29fb28ca6cf192442886b11c85a8581e2e5c3518 Mon Sep 17 00:00:00 2001 +From: Beniamino Galvani +Date: Mon, 10 Apr 2017 18:19:18 +0200 +Subject: [PATCH] vlan: use parent interface mtu as default + +VLANs already inherit the MTU from parent device when manually +activated. At boot, since the vlan interface is created before +activating the parent, the MTU is left to the default value. + +Fix this by inheriting the MTU from parent when activating the +VLAN. Note that this change is effective only when the connection has +an actual IPv4 configuration; for all other cases users should +explicitly set the desired MTU value in the 'ethernet.mtu' property. + +See master commit 7dde8d810604 ("vlan: use parent interface mtu as default") + +https://bugzilla.redhat.com/show_bug.cgi?id=1439166 +(cherry picked from commit 1c06d66a056b6a31e01ad3c91a15e80f3ba79078) +--- + src/devices/nm-device-vlan.c | 18 ++++++++++++++---- + 1 file changed, 14 insertions(+), 4 deletions(-) + +diff --git a/src/devices/nm-device-vlan.c b/src/devices/nm-device-vlan.c +index 461bae6..b053fcc 100644 +--- a/src/devices/nm-device-vlan.c ++++ b/src/devices/nm-device-vlan.c +@@ -598,19 +598,29 @@ act_stage1_prepare (NMDevice *dev, NMDeviceStateReason *reason) + static void + ip4_config_pre_commit (NMDevice *device, NMIP4Config *config) + { ++ NMDeviceVlanPrivate *priv = NM_DEVICE_VLAN_GET_PRIVATE (device); + NMConnection *connection; + NMSettingWired *s_wired; +- guint32 mtu; ++ guint32 mtu = 0; ++ int ifindex; + + connection = nm_device_get_applied_connection (device); + g_assert (connection); + + s_wired = nm_connection_get_setting_wired (connection); +- if (s_wired) { ++ if (s_wired) + mtu = nm_setting_wired_get_mtu (s_wired); +- if (mtu) +- nm_ip4_config_set_mtu (config, mtu, NM_IP_CONFIG_SOURCE_USER); ++ ++ if (!mtu && priv->parent) { ++ /* Inherit the MTU from parent device, if any */ ++ ifindex = nm_device_get_ifindex (priv->parent); ++ if (ifindex > 0) ++ mtu = nm_platform_link_get_mtu (NM_PLATFORM_GET, ifindex); + } ++ ++ if (mtu) ++ nm_ip4_config_set_mtu (config, mtu, NM_IP_CONFIG_SOURCE_USER); ++ + } + + /******************************************************************/ +-- +2.7.4 + diff --git a/SPECS/NetworkManager.spec b/SPECS/NetworkManager.spec index 162dcd1..b6f4378 100644 --- a/SPECS/NetworkManager.spec +++ b/SPECS/NetworkManager.spec @@ -12,7 +12,7 @@ %global rpm_version 1.4.0 %global real_version 1.4.0 -%global release_version 19 +%global release_version 20 %global epoch_version 1 %global obsoletes_nmver 1:0.9.9.95-1 @@ -132,6 +132,7 @@ Patch25: 0025-remove-INFERRABLE-flag-from-dhcp-hostname-rh1421082.patch Patch26: 0026-core-honor-ip-order-rh1394500.patch Patch27: 0027-manager-dispose-unrealized-devices-rh1433303.patch Patch28: 0028-force-default-route-resync.patch +Patch29: 0029-vlan-use-parent-interface-mtu-as-default.patch Requires(post): systemd Requires(preun): systemd @@ -408,6 +409,7 @@ by nm-connection-editor and nm-applet in a non-graphical environment. %patch26 -p1 %patch27 -p1 %patch28 -p1 +%patch29 -p1 %build %if %{with regen_docs} @@ -713,6 +715,9 @@ fi %endif %changelog +* Mon Apr 24 2017 Beniamino Galvani - 1:1.4.0-20 +- vlan: use parent interface mtu as default (rh#1414186) + * Wed Mar 29 2017 Beniamino Galvani - 1:1.4.0-19 - core: alyways force a sync of the default route (rh#1431268)