From: Justin Pettit Date: Mon, 6 May 2013 19:43:48 +0000 (-0700) Subject: ovsdb-client: Avoid assertion with multiple databases. X-Git-Tag: sliver-openvswitch-1.10.90-3~16^2~27 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=66980be97d99fa80de77e495bd0b7b4ad5079148;p=sliver-openvswitch.git 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 --- diff --git a/AUTHORS b/AUTHORS index 593776dd2..c113f16b9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -194,6 +194,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 53e6bb9c3..81dcc779b 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); }