mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-12 13:50:30 +01:00
device: always allow reapply of MTU from wired setting
Many device types take the MTU value from the wired setting; usually they don't implement the can_reapply_change() method and so the MTU can't be changed with the Reapply() API. Instead of implementing the method for all such devices to support the same property (adding a lot of duplicated code), add a check in NMDevice to allow the reapply of MTU when we recognize that the device uses the MTU from the wired setting. Device types can still decide to implement can_reapply_change() and support whatever properties they want, even from the wired setting. (cherry picked from commit9339d3310e) (cherry picked from commit1191eba15a)
This commit is contained in:
parent
4134023a29
commit
0064401e35
1 changed files with 8 additions and 0 deletions
|
|
@ -11497,6 +11497,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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue