mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 05:47:55 +00:00
ovsdb-idl: Fix assertion failure on error path parsing server reply.
If the database server sent an error reply to a monitor_cond request, and the error was not a JSON string, then passing the error to json_string() caused an assertion failure. Found by inspection. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
This commit is contained in:
parent
1ac62a0e09
commit
fca1b42abe
@ -552,8 +552,8 @@ ovsdb_idl_run(struct ovsdb_idl *idl)
|
|||||||
&& idl->state == IDL_S_MONITOR_COND_REQUESTED
|
&& idl->state == IDL_S_MONITOR_COND_REQUESTED
|
||||||
&& idl->request_id
|
&& idl->request_id
|
||||||
&& json_equal(idl->request_id, msg->id)) {
|
&& json_equal(idl->request_id, msg->id)) {
|
||||||
if (msg->error && !strcmp(json_string(msg->error),
|
if (msg->error && msg->error->type == JSON_STRING
|
||||||
"unknown method")) {
|
&& !strcmp(json_string(msg->error), "unknown method")) {
|
||||||
/* Fall back to using "monitor" method. */
|
/* Fall back to using "monitor" method. */
|
||||||
json_destroy(idl->request_id);
|
json_destroy(idl->request_id);
|
||||||
idl->request_id = NULL;
|
idl->request_id = NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user