summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBeniamino Galvani <bgalvani@redhat.com>2020-02-20 14:44:58 +0100
committerBeniamino Galvani <bgalvani@redhat.com>2020-02-24 09:14:30 +0100
commit720e76f4b965b563269fb70fea5cc7f699de814e (patch)
tree98e47e9733072cfc8c725196085738b451736fc5
parenta12fc59c3f1c91a8a6492d2ea1641d2b1c161035 (diff)
downloadNetworkManager-bg/ovs-no-bridge-rh1797696.tar.gz
ovs: fail port enslavement when the bridge device is not foundbg/ovs-no-bridge-rh1797696
Fail the enslavement of the ovs port if the bridge device is not found, instead of generating assertions and potentially crash later. https://bugzilla.redhat.com/show_bug.cgi?id=1797696 Fixes: 101e65d2bb19 ('ovs: allow changing mac address of bridges and interfaces')
-rw-r--r--src/devices/ovs/nm-device-ovs-port.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/devices/ovs/nm-device-ovs-port.c b/src/devices/ovs/nm-device-ovs-port.c
index 66a610530e..e021637779 100644
--- a/src/devices/ovs/nm-device-ovs-port.c
+++ b/src/devices/ovs/nm-device-ovs-port.c
@@ -103,6 +103,11 @@ enslave_slave (NMDevice *device, NMDevice *slave, NMConnection *connection, gboo
}
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),