summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2017-03-06 18:52:15 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2017-03-07 15:51:43 +0100
commiteaa55f7a0f0481dd3dcf934a916b23bc09cd3450 (patch)
tree67a8d63e4a0aee2ab873f71e84505a2069614271
parentc0d68c134fd702d8b009f8fd52076d71f7a3ed69 (diff)
downloadNetworkManager-bg/reapply.tar.gz
bridge wipbg/reapply
-rw-r--r--src/devices/nm-device-bridge.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/devices/nm-device-bridge.c b/src/devices/nm-device-bridge.c
index 0ff6e634c1..4d5d145832 100644
--- a/src/devices/nm-device-bridge.c
+++ b/src/devices/nm-device-bridge.c
@@ -418,6 +418,56 @@ create_and_realize (NMDevice *device,
return TRUE;
}
+static gboolean
+can_reapply_change (NMDevice *device,
+ const char *setting_name,
+ NMSetting *s_old,
+ NMSetting *s_new,
+ GHashTable *diffs,
+ GError **error)
+{
+ NMDeviceClass *device_class;
+
+ /* Only handle bridge setting here, delegate other settings to parent class */
+ if (nm_streq (setting_name, NM_SETTING_BRIDGE_SETTING_NAME)) {
+ return nm_device_hash_check_invalid_keys (diffs,
+ NM_SETTING_BRIDGE_SETTING_NAME,
+ error,
+ NM_SETTING_BRIDGE_STP,
+ NM_SETTING_BRIDGE_PRIORITY,
+ NM_SETTING_BRIDGE_FORWARD_DELAY,
+ NM_SETTING_BRIDGE_HELLO_TIME,
+ NM_SETTING_BRIDGE_MAX_AGE,
+ NM_SETTING_BRIDGE_AGEING_TIME,
+ NM_SETTING_BRIDGE_MULTICAST_SNOOPING);
+ }
+
+ device_class = NM_DEVICE_CLASS (nm_device_bridge_parent_class);
+ return device_class->can_reapply_change (device,
+ setting_name,
+ s_old,
+ s_new,
+ diffs,
+ error);
+}
+
+static void
+reapply_connection (NMDevice *device, NMConnection *con_old, NMConnection *con_new)
+{
+ NMDeviceBridge *self = NM_DEVICE_BRIDGE (device);
+ NMSettingBridge *s_bridge;
+
+ NM_DEVICE_CLASS (nm_device_bridge_parent_class)->reapply_connection (device,
+ con_old,
+ con_new);
+
+ _LOGD (LOGD_BRIDGE, "reapplying bridge settings");
+ s_bridge = nm_connection_get_setting_bridge (con_new);
+ g_return_if_fail (s_bridge);
+
+ commit_master_options (device, s_bridge);
+}
+
/*****************************************************************************/
static void
@@ -446,6 +496,8 @@ nm_device_bridge_class_init (NMDeviceBridgeClass *klass)
parent_class->enslave_slave = enslave_slave;
parent_class->release_slave = release_slave;
parent_class->get_configured_mtu = nm_device_get_configured_mtu_for_wired;
+ parent_class->can_reapply_change = can_reapply_change;
+ parent_class->reapply_connection = reapply_connection;
nm_exported_object_class_add_interface (NM_EXPORTED_OBJECT_CLASS (klass),
NMDBUS_TYPE_DEVICE_BRIDGE_SKELETON,