From 263e92bf491aaaaf8e917f525e544f01a478aa3b Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 5 Nov 2020 21:23:46 +0100 Subject: [PATCH] core/ovs: minor cleanup of logic in _add_interface() --- src/devices/ovs/nm-ovsdb.c | 14 ++++++++------ 1 file 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; }