The user shouldn't provide a given server's log more than once but this
check makes sure.

Signed-off-by: Ben Pfaff <[email protected]>
---
 ovsdb/ovsdb-tool.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/ovsdb/ovsdb-tool.c b/ovsdb/ovsdb-tool.c
index 6832ef7c17c0..8ac6a1b21670 100644
--- a/ovsdb/ovsdb-tool.c
+++ b/ovsdb/ovsdb-tool.c
@@ -1178,6 +1178,13 @@ do_check_cluster(struct ovs_cmdl_context *ctx)
             ovsdb_log_close(s->log);
             continue;
         }
+        for (size_t j = 0; j < c.n_servers; j++) {
+            if (uuid_equals(&s->header.sid, &c.servers[j].header.sid)) {
+                ovs_fatal(0, "Duplicate server ID "SID_FMT" in %s and %s.",
+                          SID_ARGS(&s->header.sid),
+                          s->filename, c.servers[j].filename);
+            }
+        }
         if (c.n_servers > 0) {
             struct server *s0 = &c.servers[0];
             if (!uuid_equals(&s0->header.cid, &s->header.cid)) {
-- 
2.16.1

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to