mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-04 15:40:22 +01:00
core: update hardware address when slaves change
The hardware address of a device often changes when slaves change, for example with bond interfaces, which take the hardware address of their first slave. Make sure that's always up-to-date.
This commit is contained in:
parent
a11771dfe6
commit
7651c77b78
1 changed files with 14 additions and 0 deletions
|
|
@ -850,6 +850,13 @@ nm_device_enslave_slave (NMDevice *dev, NMDevice *slave, NMConnection *connectio
|
|||
info->enslaved = TRUE;
|
||||
nm_device_slave_notify_enslaved (info->slave, TRUE, FALSE);
|
||||
}
|
||||
|
||||
/* Ensure the device's hardware address is up-to-date; it often changes
|
||||
* when slaves change.
|
||||
*/
|
||||
if (NM_DEVICE_GET_CLASS (dev)->update_hw_address)
|
||||
NM_DEVICE_GET_CLASS (dev)->update_hw_address (dev);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
@ -887,6 +894,13 @@ nm_device_release_one_slave (NMDevice *dev, NMDevice *slave, gboolean failed)
|
|||
|
||||
priv->slaves = g_slist_remove (priv->slaves, info);
|
||||
free_slave_info (info);
|
||||
|
||||
/* Ensure the device's hardware address is up-to-date; it often changes
|
||||
* when slaves change.
|
||||
*/
|
||||
if (NM_DEVICE_GET_CLASS (dev)->update_hw_address)
|
||||
NM_DEVICE_GET_CLASS (dev)->update_hw_address (dev);
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue