mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-03-01 06:50:33 +01:00
ovs: fail port enslavement when the bridge AC is not found
The previous code tried to get the bridge active connection and it used the port active connection instead in case of failure. This doesn't seem right, as in nm-ovsdb.c the bridge AC is used to get the bridge settings (including the uuid, interface name, and cloned mac). In case of failure getting the bridge AC we should just fail. Fixes:830a5a14cb('device: add support for OpenVSwitch devices') (cherry picked from commitc8b5a3f91a) (cherry picked from commitd8fb95d22b) (cherry picked from commit323a557f74)
This commit is contained in:
parent
4479c026b8
commit
d1082e6323
1 changed files with 6 additions and 2 deletions
|
|
@ -100,6 +100,7 @@ add_iface_cb (GError *error, gpointer user_data)
|
|||
static gboolean
|
||||
enslave_slave (NMDevice *device, NMDevice *slave, NMConnection *connection, gboolean configure)
|
||||
{
|
||||
NMDeviceOvsPort *self = NM_DEVICE_OVS_PORT (device);
|
||||
NMActiveConnection *ac_port = NULL;
|
||||
NMActiveConnection *ac_bridge = NULL;
|
||||
NMDevice *bridge_device;
|
||||
|
|
@ -109,8 +110,11 @@ enslave_slave (NMDevice *device, NMDevice *slave, NMConnection *connection, gboo
|
|||
|
||||
ac_port = NM_ACTIVE_CONNECTION (nm_device_get_act_request (device));
|
||||
ac_bridge = nm_active_connection_get_master (ac_port);
|
||||
if (!ac_bridge)
|
||||
ac_bridge = ac_port;
|
||||
if (!ac_bridge) {
|
||||
_LOGW (LOGD_DEVICE, "can't enslave %s: bridge active-connection not found",
|
||||
nm_device_get_iface (slave));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bridge_device = nm_active_connection_get_device (ac_bridge);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue