summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-12-11 13:36:15 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2019-12-11 13:36:15 +0100
commitce2cceef83f3a720922f5c906c641466809e6ba4 (patch)
treefcd80436ec893ec6c37054bfdd1c1de131a755ed
parent218fd9e1fcd5a5e8cdbed9b0778cd916390b9c0d (diff)
parent9339d3310e48e14f58428ec923ed9c653df1693b (diff)
downloadNetworkManager-ce2cceef83f3a720922f5c906c641466809e6ba4.tar.gz
merge: branch 'bg/mtu-reapply-rh1779162'
https://bugzilla.redhat.com/show_bug.cgi?id=1779162 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/356
-rw-r--r--src/devices/nm-device-infiniband.c27
-rw-r--r--src/devices/nm-device.c8
2 files changed, 35 insertions, 0 deletions
diff --git a/src/devices/nm-device-infiniband.c b/src/devices/nm-device-infiniband.c
index 24593ff1f5..9f79d9bbf6 100644
--- a/src/devices/nm-device-infiniband.c
+++ b/src/devices/nm-device-infiniband.c
@@ -191,6 +191,32 @@ update_connection (NMDevice *device, NMConnection *connection)
}
static gboolean
+can_reapply_change (NMDevice *device,
+ const char *setting_name,
+ NMSetting *s_old,
+ NMSetting *s_new,
+ GHashTable *diffs,
+ GError **error)
+{
+ NMDeviceClass *device_class;
+
+ if (nm_streq (setting_name, NM_SETTING_INFINIBAND_SETTING_NAME)) {
+ return nm_device_hash_check_invalid_keys (diffs,
+ NM_SETTING_INFINIBAND_SETTING_NAME,
+ error,
+ NM_SETTING_INFINIBAND_MTU); /* reapplied with IP config */
+ }
+
+ device_class = NM_DEVICE_CLASS (nm_device_infiniband_parent_class);
+ return device_class->can_reapply_change (device,
+ setting_name,
+ s_old,
+ s_new,
+ diffs,
+ error);
+}
+
+static gboolean
create_and_realize (NMDevice *device,
NMConnection *connection,
NMDevice *parent,
@@ -342,6 +368,7 @@ nm_device_infiniband_class_init (NMDeviceInfinibandClass *klass)
device_class->connection_type_check_compatible = NM_SETTING_INFINIBAND_SETTING_NAME;
device_class->link_types = NM_DEVICE_DEFINE_LINK_TYPES (NM_LINK_TYPE_INFINIBAND);
+ device_class->can_reapply_change = can_reapply_change;
device_class->create_and_realize = create_and_realize;
device_class->unrealize = unrealize;
device_class->get_generic_capabilities = get_generic_capabilities;
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c
index c50aa42ac7..3b595938df 100644
--- a/src/devices/nm-device.c
+++ b/src/devices/nm-device.c
@@ -11752,6 +11752,14 @@ can_reapply_change (NMDevice *self,
NM_SETTING_IP4_CONFIG_SETTING_NAME,
NM_SETTING_IP6_CONFIG_SETTING_NAME)) {
return TRUE;
+ } else if ( nm_streq (setting_name, NM_SETTING_WIRED_SETTING_NAME)
+ && NM_IN_SET (NM_DEVICE_GET_CLASS (self)->get_configured_mtu,
+ nm_device_get_configured_mtu_wired_parent,
+ nm_device_get_configured_mtu_for_wired)) {
+ return nm_device_hash_check_invalid_keys (diffs,
+ NM_SETTING_WIRED_SETTING_NAME,
+ error,
+ NM_SETTING_WIRED_MTU);
} else {
g_set_error (error,
NM_DEVICE_ERROR,