about summary refs log tree commit diff
path: root/src/devices/ovs
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2020-03-13 16:27:57 +0100
committerSebastien Bacher <seb128@ubuntu.com>2020-03-13 16:27:57 +0100
commita46c3e57291e64e9258698dbe5b0ef11def833c5 (patch)
treede9a6dcb3ab058a02fa0a2d9e7d1b3572b588583 /src/devices/ovs
parent767904eab32f132502230df57e146cb822dad7ba (diff)
parent19e73abd360f0198f94ce49f36ddf009056f6324 (diff)
Merge remote-tracking branch 'salsa/debian/master' into ubuntu/master
Diffstat (limited to 'src/devices/ovs')
-rw-r--r--src/devices/ovs/nm-device-ovs-port.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/devices/ovs/nm-device-ovs-port.c b/src/devices/ovs/nm-device-ovs-port.c
index 0955e8a9..e0216377 100644
--- a/src/devices/ovs/nm-device-ovs-port.c
+++ b/src/devices/ovs/nm-device-ovs-port.c
@@ -86,6 +86,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;
@@ -95,10 +96,18 @@ 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);
+	if (!bridge_device) {
+		_LOGW (LOGD_DEVICE, "can't enslave %s: bridge device not found",
+		       nm_device_get_iface (slave));
+		return FALSE;
+	}
 
 	nm_ovsdb_add_interface (nm_ovsdb_get (),
 	                        nm_active_connection_get_applied_connection (ac_bridge),