mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-04 09:44:16 +00:00
[client/host] added enforcement of KVMFR versioning
This commit is contained in:
@@ -1446,7 +1446,11 @@ static int lg_run()
|
||||
LGMP_STATUS status;
|
||||
while(true)
|
||||
{
|
||||
if ((status = lgmpClientInit(state.shm.mem, state.shm.size, &state.lgmp)) == LGMP_OK)
|
||||
uint32_t udataSize;
|
||||
KVMFR *udata;
|
||||
|
||||
if ((status = lgmpClientInit(state.shm.mem, state.shm.size, &state.lgmp,
|
||||
&udataSize, (uint8_t **)&udata)) == LGMP_OK)
|
||||
break;
|
||||
|
||||
if (status == LGMP_ERR_INVALID_SESSION || status == LGMP_ERR_INVALID_MAGIC)
|
||||
@@ -1455,6 +1459,16 @@ static int lg_run()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (udataSize != sizeof(KVMFR) ||
|
||||
memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 ||
|
||||
udata->version != KVMFR_VERSION)
|
||||
{
|
||||
DEBUG_ERROR("The host application is not compatible with this client");
|
||||
DEBUG_ERROR("Expected KVMFR version %d\n", KVMFR_VERSION);
|
||||
DEBUG_ERROR("This is not a Looking Glass error, do not report this");
|
||||
return -1;
|
||||
}
|
||||
|
||||
DEBUG_ERROR("lgmpClientInit Failed: %s", lgmpStatusString(status));
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user