From 5dfc46da5240a9b18cda7c1dd2c08973b04b25de Mon Sep 17 00:00:00 2001 From: Ilya Maximets Date: Tue, 12 Dec 2023 12:25:25 +0100 Subject: [PATCH] jsonrpc-server: Re-add remotes on role changes. It is currently not possible for the role to change in runtime, but it will be with addition of a config file. If role changes, listening socket will be closed, and all the connections to this remote will be terminated. Signed-off-by: Ilya Maximets --- ovsdb/jsonrpc-server.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ovsdb/jsonrpc-server.c b/ovsdb/jsonrpc-server.c index 617f5a7991e..417ff06f010 100644 --- a/ovsdb/jsonrpc-server.c +++ b/ovsdb/jsonrpc-server.c @@ -330,7 +330,8 @@ ovsdb_jsonrpc_server_set_remotes(struct ovsdb_jsonrpc_server *svr, if (!options) { VLOG_INFO("%s: remote deconfigured", node->name); ovsdb_jsonrpc_server_del_remote(node); - } else if (options->dscp != remote->dscp) { + } else if (options->dscp != remote->dscp + || !nullable_string_is_equal(options->role, remote->role)) { ovsdb_jsonrpc_server_del_remote(node); } }