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 <jpettit@nicira.com>
Reported-by: Spiro Kourtessis <spiro@vmware.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
svec_add(dbs, name->u.string);
}
jsonrpc_msg_destroy(reply);
+ svec_sort(&dbs);
}
\f
static void
svec_init(&dbs);
fetch_dbs(rpc, &dbs);
- svec_sort(&dbs);
SVEC_FOR_EACH (i, db_name, &dbs) {
puts(db_name);
}