diff options
author | Beniamino Galvani <bgalvani@redhat.com> | 2020-12-10 17:17:17 +0100 |
---|---|---|
committer | Beniamino Galvani <bgalvani@redhat.com> | 2020-12-11 12:01:54 +0100 |
commit | 61374bded796546847996cfdbf99b1d3f3562c3d (patch) | |
tree | 5cb70b6f6091a4fe6be371703b9bb95a2e1625c2 | |
parent | e5b8fad96ed5a0c187d950c8ba1b531a791b25d9 (diff) | |
download | NetworkManager-bg/rh1861296-pt2.tar.gz |
ovs: perform the initial cleanup only on first startbg/rh1861296-pt2
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
-rw-r--r-- | src/devices/ovs/nm-ovsdb.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |