ipc: icmsg: Allow to support future versions
Allow magic number to be longer than the sizeof(magic). This will allow to support future versions of the icmsg with backwards compatibility. Signed-off-by: Emil Obalski <Emil.Obalski@nordicsemi.no>
This commit is contained in:
parent
eb4fc3f083
commit
d769a92520
1 changed files with 3 additions and 1 deletions
|
|
@ -147,7 +147,9 @@ static void mbox_callback_process(struct k_work *item)
|
||||||
} else {
|
} else {
|
||||||
__ASSERT_NO_MSG(state == ICMSG_STATE_BUSY);
|
__ASSERT_NO_MSG(state == ICMSG_STATE_BUSY);
|
||||||
|
|
||||||
bool endpoint_invalid = (len != sizeof(magic) || memcmp(magic, rx_buffer, len));
|
/* Allow magic number longer than sizeof(magic) for future protocol version. */
|
||||||
|
bool endpoint_invalid = (len < sizeof(magic) ||
|
||||||
|
memcmp(magic, rx_buffer, sizeof(magic)));
|
||||||
|
|
||||||
if (endpoint_invalid) {
|
if (endpoint_invalid) {
|
||||||
__ASSERT_NO_MSG(false);
|
__ASSERT_NO_MSG(false);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue