From 61374bded796546847996cfdbf99b1d3f3562c3d Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Thu, 10 Dec 2020 17:17:17 +0100 Subject: ovs: perform the initial cleanup only on first start When NM is restarted, devices can be "assumed": NM tracks what was the connection active before the restart and after the restart bypasses most of the setup phases, bringing the device into the activate state. When an OVS system interface is assumed after a daemon restart, it can reach the activated state even before NM connects to the ovsdb. Later, upon connection to ovsdb, the cleanup of initial OVS interfaces wrongly deletes the interface record. Perform the initial ovsdb cleanup only during the first start. Fixes: e5113a7fd91b ('ovs: clean up interfaces from ovsdb at startup') https://bugzilla.redhat.com/show_bug.cgi?id=1861296 --- src/devices/ovs/nm-ovsdb.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/devices/ovs/nm-ovsdb.c b/src/devices/ovs/nm-ovsdb.c index 78152cd8c5..149a152af8 100644 --- a/src/devices/ovs/nm-ovsdb.c +++ b/src/devices/ovs/nm-ovsdb.c @@ -12,6 +12,7 @@ #include "nm-glib-aux/nm-jansson.h" #include "nm-glib-aux/nm-str-buf.h" +#include "nm-config.h" #include "nm-core-utils.h" #include "nm-core-internal.h" #include "devices/nm-device.h" @@ -2277,6 +2278,9 @@ ovsdb_cleanup_initial_interfaces(NMOvsdb *self) NMUtilsUserData * data; GHashTableIter iter; + if (!nm_config_get_first_start(nm_config_get())) + return; + if (priv->cleanup_done) return; priv->cleanup_done = TRUE; -- cgit v1.2.1