summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2019-12-16 09:57:24 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2019-12-16 09:57:24 +0100
commit1e9ab78bfc9bd21e8e3c4f21a501bde2eccb746f (patch)
tree6dea8eedebead47e23ba141155e173d78c668a82
parent7c3209532015d85a498df121d1856ae2fd17c3ae (diff)
downloadNetworkManager-bg/rh1782701.tar.gz
ovs: fail enslavement if bridge device is missingbg/rh1782701
-rw-r--r--src/devices/ovs/nm-device-ovs-port.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/devices/ovs/nm-device-ovs-port.c b/src/devices/ovs/nm-device-ovs-port.c
index 0955e8a92b..998993c335 100644
--- a/src/devices/ovs/nm-device-ovs-port.c
+++ b/src/devices/ovs/nm-device-ovs-port.c
@@ -86,19 +86,27 @@ 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;
+ NMActiveConnection *ac_master = NULL;
NMDevice *bridge_device;
if (!configure)
return TRUE;
ac_port = NM_ACTIVE_CONNECTION (nm_device_get_act_request (device));
- ac_bridge = nm_active_connection_get_master (ac_port);
+ ac_master = ac_bridge = nm_active_connection_get_master (ac_port);
if (!ac_bridge)
ac_bridge = ac_port;
bridge_device = nm_active_connection_get_device (ac_bridge);
+ _LOGD (LOGD_CORE, "ac_master %p, ac_port %p, bridge_device %p", ac_master, ac_port, bridge_device);
+
+ if (!bridge_device) {
+ _LOGW (LOGD_CORE, " ---- enslaving failed due to missing bridge device");
+ return FALSE;
+ }
nm_ovsdb_add_interface (nm_ovsdb_get (),
nm_active_connection_get_applied_connection (ac_bridge),