summaryrefslogtreecommitdiffstats
path: root/mboxd_msg.c
diff options
context:
space:
mode:
authorAndrew Jeffery <andrew@aj.id.au>2017-04-24 11:17:42 +0930
committerAndrew Jeffery <andrew@aj.id.au>2017-04-24 12:47:30 +0930
commitfb25aa77ffe3b12bb9c3f62708f15b85eaaac580 (patch)
treeddffa606f32a33eae15c8ad58c2286394e6e5f2d /mboxd_msg.c
parentac243b477a2088a0de4e5aa76d665b613e21ed6b (diff)
downloadphosphor-mboxd-fb25aa77ffe3b12bb9c3f62708f15b85eaaac580.tar.gz
phosphor-mboxd-fb25aa77ffe3b12bb9c3f62708f15b85eaaac580.zip
mbox: Clarify protocol version negotion
The specification intended that the mbox daemon return its highest supported protocol version less-than-or-equal to the version requested by the host. This was not clear in the documentation and was not the behaviour implemented by the daemon. Fix both the documentation and the daemon to perform to this expectation. Change-Id: I6f9cf0b16d2b9319d69656eb26defb46dccd4ddf Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Diffstat (limited to 'mboxd_msg.c')
-rw-r--r--mboxd_msg.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/mboxd_msg.c b/mboxd_msg.c
index 179af60..84e8d9a 100644
--- a/mboxd_msg.c
+++ b/mboxd_msg.c
@@ -176,10 +176,12 @@ static int mbox_handle_mbox_info(struct mbox_context *context,
int rc;
/* Check we support the version requested */
- if (mbox_api_version < API_MIN_VERSION ||
- mbox_api_version > API_MAX_VERSION) {
+ if (mbox_api_version < API_MIN_VERSION)
return -MBOX_R_PARAM_ERROR;
- }
+
+ if (mbox_api_version > API_MAX_VERSION)
+ mbox_api_version = API_MAX_VERSION;
+
context->version = mbox_api_version;
MSG_OUT("Using Protocol Version: %d\n", context->version);
OpenPOWER on IntegriCloud