diff --git a/VERSION b/VERSION index 9b61845a..0bad939d 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B2-rc2-1-gbc7871f630+1 \ No newline at end of file +B2-rc2-2-g667ab981ba+1 \ No newline at end of file diff --git a/client/src/main.c b/client/src/main.c index c9624752..82ad775c 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -1474,19 +1474,25 @@ static int lg_run() if (!state.running) return -1; - if (udataSize != sizeof(KVMFR) || - memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) != 0 || - udata->version != KVMFR_VERSION) + const bool magicMatches = memcmp(udata->magic, KVMFR_MAGIC, sizeof(udata->magic)) == 0; + if (udataSize != sizeof(KVMFR) || !magicMatches || udata->version != KVMFR_VERSION) { DEBUG_BREAK(); DEBUG_ERROR("The host application is not compatible with this client"); - DEBUG_ERROR("Expected KVMFR version %d", KVMFR_VERSION); DEBUG_ERROR("This is not a Looking Glass error, do not report this"); + DEBUG_ERROR("Please install the matching host application for this client"); + + if (magicMatches) + DEBUG_ERROR("Expected KVMFR version %d, got %d", KVMFR_VERSION, udata->version); + else + DEBUG_ERROR("Invalid KVMFR magic"); + DEBUG_BREAK(); return -1; } - DEBUG_INFO("Host ready, starting session"); + DEBUG_INFO("Host ready, reported version: %s", udata->hostver); + DEBUG_INFO("Starting session"); if (!lgCreateThread("cursorThread", cursorThread, NULL, &t_cursor)) { diff --git a/common/include/common/KVMFR.h b/common/include/common/KVMFR.h index 701ccd36..8557d878 100644 --- a/common/include/common/KVMFR.h +++ b/common/include/common/KVMFR.h @@ -51,12 +51,13 @@ typedef enum CursorType CursorType; #define KVMFR_MAGIC "KVMFR---" -#define KVMFR_VERSION 1 +#define KVMFR_VERSION 2 typedef struct KVMFR { char magic[8]; uint32_t version; + char hostver[32]; } KVMFR; diff --git a/host/src/app.c b/host/src/app.c index 67729765..22e48012 100644 --- a/host/src/app.c +++ b/host/src/app.c @@ -435,9 +435,10 @@ int app_main(int argc, char * argv[]) DEBUG_INFO("Max Pointer Size : %u KiB", (unsigned int)MAX_POINTER_SIZE / 1024); DEBUG_INFO("KVMFR Version : %u", KVMFR_VERSION); - KVMFR udata = { + const KVMFR udata = { .magic = KVMFR_MAGIC, - .version = KVMFR_VERSION + .version = KVMFR_VERSION, + .hostver = BUILD_VERSION }; LGMP_STATUS status;