mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-02 20:30:13 +01:00
device: ignore enslavement to ovs-master
That one is special. All interfaces that are attached to OpenVSwitch ports appear as slaves to that one even for our purposes we like to pretend they're slaves to the actual OpenVSwitch bridges.
This commit is contained in:
parent
6af5030cf2
commit
c843fe4783
1 changed files with 24 additions and 13 deletions
|
|
@ -2538,12 +2538,27 @@ static void
|
|||
device_recheck_slave_status (NMDevice *self, const NMPlatformLink *plink)
|
||||
{
|
||||
NMDevicePrivate *priv = NM_DEVICE_GET_PRIVATE (self);
|
||||
NMDevice *master;
|
||||
nm_auto_nmpobj const NMPObject *plink_master_keep_alive = NULL;
|
||||
const NMPlatformLink *plink_master;
|
||||
|
||||
g_return_if_fail (plink);
|
||||
|
||||
if (plink->master <= 0)
|
||||
return;
|
||||
|
||||
master = nm_manager_get_device_by_ifindex (nm_manager_get (), plink->master);
|
||||
plink_master = nm_platform_link_get (nm_device_get_platform (self), plink->master);
|
||||
plink_master_keep_alive = nmp_object_ref (NMP_OBJECT_UP_CAST (plink_master));
|
||||
|
||||
if ( master == NULL
|
||||
&& plink_master
|
||||
&& g_strcmp0 (plink_master->name, "ovs-system") == 0
|
||||
&& plink_master->type == NM_LINK_TYPE_OPENVSWITCH) {
|
||||
_LOGD (LOGD_DEVICE, "the device claimed by openvswitch");
|
||||
return;
|
||||
}
|
||||
|
||||
if (priv->master) {
|
||||
if ( plink->master > 0
|
||||
&& plink->master == nm_device_get_ifindex (priv->master)) {
|
||||
|
|
@ -2555,20 +2570,16 @@ device_recheck_slave_status (NMDevice *self, const NMPlatformLink *plink)
|
|||
|
||||
nm_device_master_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_CONNECTION_ASSUMED);
|
||||
}
|
||||
if (plink->master > 0) {
|
||||
NMDevice *master;
|
||||
|
||||
master = nm_manager_get_device_by_ifindex (nm_manager_get (), plink->master);
|
||||
if (master && NM_DEVICE_GET_CLASS (master)->enslave_slave)
|
||||
nm_device_master_add_slave (master, self, FALSE);
|
||||
else if (master) {
|
||||
_LOGI (LOGD_DEVICE, "enslaved to non-master-type device %s; ignoring",
|
||||
nm_device_get_iface (master));
|
||||
} else {
|
||||
_LOGW (LOGD_DEVICE, "enslaved to unknown device %d %s",
|
||||
plink->master,
|
||||
nm_platform_link_get_name (nm_device_get_platform (self), plink->master));
|
||||
}
|
||||
if (master && NM_DEVICE_GET_CLASS (master)->enslave_slave)
|
||||
nm_device_master_add_slave (master, self, FALSE);
|
||||
else if (master) {
|
||||
_LOGI (LOGD_DEVICE, "enslaved to non-master-type device %s; ignoring",
|
||||
nm_device_get_iface (master));
|
||||
} else {
|
||||
_LOGW (LOGD_DEVICE, "enslaved to unknown device %d (%s%s%s)",
|
||||
plink->master,
|
||||
NM_PRINT_FMT_QUOTED (plink_master, "\"", plink_master->name, "\"", "??"));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue