device: add 'master_ifindex' field to NMDevice

https://bugzilla.redhat.com/show_bug.cgi?id=1870691

Signed-off-by: Antonio Cardace <acardace@redhat.com>
This commit is contained in:
Antonio Cardace 2021-01-20 19:25:51 +01:00
parent d2d74f99a9
commit 84dc705159
No known key found for this signature in database
GPG key ID: 6BF80ABD43E377D3

View file

@ -642,6 +642,7 @@ typedef struct _NMDevicePrivate {
/* master interface for bridge/bond/team slave */
NMDevice *master;
gulong master_ready_id;
int master_ifindex;
/* slave management */
CList slaves; /* list of SlaveInfo */
@ -5116,6 +5117,8 @@ device_recheck_slave_status(NMDevice *self, const NMPlatformLink *plink)
return;
}
priv->master_ifindex = plink->master;
if (priv->master) {
if (plink->master > 0 && plink->master == nm_device_get_ifindex(priv->master)) {
/* call add-slave again. We expect @self already to be added to
@ -6197,6 +6200,8 @@ nm_device_unrealize(NMDevice *self, gboolean remove_resources, GError **error)
if (nm_clear_g_free(&priv->ip_iface_))
_notify(self, PROP_IP_IFACE);
priv->master_ifindex = 0;
_set_mtu(self, 0);
if (priv->driver_version) {