mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-05 08:00:15 +01:00
device: allow reapply of MTU
The MTU is reapplied together with IP configuration: modify device subclasses to announce they support the property in can_reapply_change().
This commit is contained in:
parent
9cc9ce4bfa
commit
ad3fdcd90d
3 changed files with 57 additions and 0 deletions
|
|
@ -1637,6 +1637,7 @@ can_reapply_change (NMDevice *device,
|
|||
return nm_device_hash_check_invalid_keys (diffs,
|
||||
NM_SETTING_WIRED_SETTING_NAME,
|
||||
error,
|
||||
NM_SETTING_WIRED_MTU, /* reapplied with IP config */
|
||||
NM_SETTING_WIRED_SPEED,
|
||||
NM_SETTING_WIRED_DUPLEX,
|
||||
NM_SETTING_WIRED_AUTO_NEGOTIATE,
|
||||
|
|
|
|||
|
|
@ -784,6 +784,33 @@ unrealize_notify (NMDevice *device)
|
|||
update_properties_from_ifindex (device, 0);
|
||||
}
|
||||
|
||||
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 ip-tunnel setting here, delegate other settings to parent class */
|
||||
if (nm_streq (setting_name, NM_SETTING_IP_TUNNEL_SETTING_NAME)) {
|
||||
return nm_device_hash_check_invalid_keys (diffs,
|
||||
NM_SETTING_IP_TUNNEL_SETTING_NAME,
|
||||
error,
|
||||
NM_SETTING_IP_TUNNEL_MTU); /* reapplied with IP config */
|
||||
}
|
||||
|
||||
device_class = NM_DEVICE_CLASS (nm_device_ip_tunnel_parent_class);
|
||||
return device_class->can_reapply_change (device,
|
||||
setting_name,
|
||||
s_old,
|
||||
s_new,
|
||||
diffs,
|
||||
error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
|
|
@ -891,6 +918,7 @@ nm_device_ip_tunnel_class_init (NMDeviceIPTunnelClass *klass)
|
|||
object_class->set_property = set_property;
|
||||
|
||||
device_class->link_changed = link_changed;
|
||||
device_class->can_reapply_change = can_reapply_change;
|
||||
device_class->complete_connection = complete_connection;
|
||||
device_class->update_connection = update_connection;
|
||||
device_class->check_connection_compatible = check_connection_compatible;
|
||||
|
|
|
|||
|
|
@ -3067,6 +3067,33 @@ set_enabled (NMDevice *device, gboolean enabled)
|
|||
}
|
||||
}
|
||||
|
||||
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 wireless setting here, delegate other settings to parent class */
|
||||
if (nm_streq (setting_name, NM_SETTING_WIRELESS_SETTING_NAME)) {
|
||||
return nm_device_hash_check_invalid_keys (diffs,
|
||||
NM_SETTING_WIRELESS_SETTING_NAME,
|
||||
error,
|
||||
NM_SETTING_WIRELESS_MTU); /* reapplied with IP config */
|
||||
}
|
||||
|
||||
device_class = NM_DEVICE_CLASS (nm_device_wifi_parent_class);
|
||||
return device_class->can_reapply_change (device,
|
||||
setting_name,
|
||||
s_old,
|
||||
s_new,
|
||||
diffs,
|
||||
error);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
static void
|
||||
|
|
@ -3232,6 +3259,7 @@ nm_device_wifi_class_init (NMDeviceWifiClass *klass)
|
|||
parent_class->deactivate = deactivate;
|
||||
parent_class->deactivate_reset_hw_addr = deactivate_reset_hw_addr;
|
||||
parent_class->unmanaged_on_quit = unmanaged_on_quit;
|
||||
parent_class->can_reapply_change = can_reapply_change;
|
||||
|
||||
parent_class->state_changed = device_state_changed;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue