summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiří Klimeš <jklimes@redhat.com>2015-01-06 19:09:46 +0100
committerJiří Klimeš <jklimes@redhat.com>2015-08-27 10:22:00 +0200
commit7d3a4178a5d527725de22fe27ae1819e875ea168 (patch)
tree6259feed2aaf431c306961ec955256f90e256cfb
parent905220b337dbabaead3469673f3d5c1fdb9933d0 (diff)
downloadNetworkManager-7d3a4178a5d527725de22fe27ae1819e875ea168.tar.gz
team: allow overriding the MTU for team device (rh #1255927)
Set the MTU if 802-3-ethernet.mtu is present and non-zero. The ifcfg-rh writer sets it if there's a MTU key. The same change as for bond in commit a169a79a7df1dbb8d966937c9cb887ffc6a63695. https://bugzilla.redhat.com/show_bug.cgi?id=1255927
-rw-r--r--src/devices/team/nm-device-team.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/devices/team/nm-device-team.c b/src/devices/team/nm-device-team.c
index 66e77e65c1..bd41b33bf2 100644
--- a/src/devices/team/nm-device-team.c
+++ b/src/devices/team/nm-device-team.c
@@ -35,6 +35,7 @@
#include "nm-enum-types.h"
#include "nm-team-enum-types.h"
#include "nm-core-internal.h"
+#include "nm-ip4-config.h"
#include "nm-dbus-compat.h"
#include "nmdbus-device-team.h"
@@ -560,6 +561,25 @@ act_stage1_prepare (NMDevice *device, NMDeviceStateReason *reason)
}
static void
+ip4_config_pre_commit (NMDevice *self, NMIP4Config *config)
+{
+ NMConnection *connection;
+ NMSettingWired *s_wired;
+ guint32 mtu;
+
+ connection = nm_device_get_connection (self);
+ g_assert (connection);
+ s_wired = nm_connection_get_setting_wired (connection);
+
+ if (s_wired) {
+ /* MTU override */
+ mtu = nm_setting_wired_get_mtu (s_wired);
+ if (mtu)
+ nm_ip4_config_set_mtu (config, mtu, NM_IP_CONFIG_SOURCE_USER);
+ }
+}
+
+static void
deactivate (NMDevice *device)
{
NMDeviceTeam *self = NM_DEVICE_TEAM (device);
@@ -801,6 +821,7 @@ nm_device_team_class_init (NMDeviceTeamClass *klass)
parent_class->master_update_slave_connection = master_update_slave_connection;
parent_class->act_stage1_prepare = act_stage1_prepare;
+ parent_class->ip4_config_pre_commit = ip4_config_pre_commit;
parent_class->deactivate = deactivate;
parent_class->enslave_slave = enslave_slave;
parent_class->release_slave = release_slave;