summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-11-05 21:23:46 +0100
committerThomas Haller <thaller@redhat.com>2020-11-09 17:53:17 +0100
commit263e92bf491aaaaf8e917f525e544f01a478aa3b (patch)
treedaed08d7e364c1db460aed8d88049ae4c24ea99c
parent8d78f8effb67a6c5dca93dbbaa45efd4a0196ecb (diff)
downloadNetworkManager-263e92bf491aaaaf8e917f525e544f01a478aa3b.tar.gz
core/ovs: minor cleanup of logic in _add_interface()
-rw-r--r--src/devices/ovs/nm-ovsdb.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/devices/ovs/nm-ovsdb.c b/src/devices/ovs/nm-ovsdb.c
index b1d09ce5b8..8c59b40262 100644
--- a/src/devices/ovs/nm-ovsdb.c
+++ b/src/devices/ovs/nm-ovsdb.c
@@ -781,11 +781,12 @@ _add_interface(NMOvsdb * self,
/* This would be a violation of ovsdb's reference integrity (a bug). */
_LOGW("Unknown port '%s' in bridge '%s'", port_uuid, bridge_uuid);
continue;
- } else if (!nm_streq(ovs_port->name, port_name)
- || !nm_streq0(ovs_port->connection_uuid, nm_connection_get_uuid(port))) {
- continue;
}
+ if (!nm_streq(ovs_port->name, port_name)
+ || !nm_streq0(ovs_port->connection_uuid, nm_connection_get_uuid(port)))
+ continue;
+
for (ii = 0; ii < ovs_port->interfaces->len; ii++) {
interface_uuid = g_ptr_array_index(ovs_port->interfaces, ii);
ovs_interface = g_hash_table_lookup(priv->interfaces, interface_uuid);
@@ -795,9 +796,10 @@ _add_interface(NMOvsdb * self,
if (!ovs_interface) {
/* This would be a violation of ovsdb's reference integrity (a bug). */
_LOGW("Unknown interface '%s' in port '%s'", interface_uuid, port_uuid);
- } else if (nm_streq(ovs_interface->name, interface_name)
- && nm_streq0(ovs_interface->connection_uuid,
- nm_connection_get_uuid(interface)))
+ continue;
+ }
+ if (nm_streq(ovs_interface->name, interface_name)
+ && nm_streq0(ovs_interface->connection_uuid, nm_connection_get_uuid(interface)))
has_interface = TRUE;
}