From b031b4dd05c0678997cf0ca53bb8ced548de746f Mon Sep 17 00:00:00 2001 From: Justin Pettit Date: Mon, 6 May 2013 12:43:48 -0700 Subject: [PATCH] ovsdb-client: Avoid assertion with multiple databases. When using ovsdb-client with an ovsdb-server with multiple databases, an assertion could trigger due to them being returned in non-sorted order. This commit changes the fetch_dbs() function to always return databases in sorted order, since both callers are expecting that behavior. Bug #16882 Signed-off-by: Justin Pettit Reported-by: Spiro Kourtessis --- AUTHORS | 1 + ovsdb/ovsdb-client.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index c11b26c5f..5a1b5bbd2 100644 --- a/AUTHORS +++ b/AUTHORS @@ -184,6 +184,7 @@ Scott Hendricks shendricks@nicira.com Sean Brady sbrady@gtfservices.com Sebastian Andrzej Siewior sebastian@breakpoint.cc Sébastien RICCIO sr@swisscenter.com +Spiro Kourtessis spiro@vmware.com Srini Seetharaman seethara@stanford.edu Stephen Hemminger shemminger@vyatta.com Takayuki HAMA t-hama@cb.jp.nec.com diff --git a/ovsdb/ovsdb-client.c b/ovsdb/ovsdb-client.c index 37bd1aa2f..bba9782ce 100644 --- a/ovsdb/ovsdb-client.c +++ b/ovsdb/ovsdb-client.c @@ -392,6 +392,7 @@ fetch_dbs(struct jsonrpc *rpc, struct svec *dbs) svec_add(dbs, name->u.string); } jsonrpc_msg_destroy(reply); + svec_sort(&dbs); } static void @@ -404,7 +405,6 @@ do_list_dbs(struct jsonrpc *rpc, const char *database OVS_UNUSED, svec_init(&dbs); fetch_dbs(rpc, &dbs); - svec_sort(&dbs); SVEC_FOR_EACH (i, db_name, &dbs) { puts(db_name); } -- 2.20.1