From: Mathieu Desnoyers Date: Thu, 2 Feb 2012 16:41:58 +0000 (-0500) Subject: Verify UST comm proto version X-Git-Tag: v2.0-pre19~6 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;ds=sidebyside;h=3f2c5fcc29e125fd43d1c63e422a389e82a3379f;hp=3f3c65dc272231540b815e48c3124ab831ca990b;p=lttng-tools.git Verify UST comm proto version Signed-off-by: Mathieu Desnoyers --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 778880487..2b66b92c0 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1275,6 +1275,13 @@ int ust_app_register(struct ust_register_msg *msg, int sock) close(sock); return -EINVAL; } + if (msg->major != LTTNG_UST_COMM_MAJOR) { + ERR("Registration failed: application \"%s\" (pid: %d) has " + "communication protocol version %u.%u, but sessiond supports 2.x.\n", + msg->name, msg->pid, msg->major, msg->minor); + close(sock); + return -EINVAL; + } lta = zmalloc(sizeof(struct ust_app)); if (lta == NULL) { PERROR("malloc"); diff --git a/src/bin/lttng-sessiond/ust-app.h b/src/bin/lttng-sessiond/ust-app.h index 0fb854fbe..5bfecdb47 100644 --- a/src/bin/lttng-sessiond/ust-app.h +++ b/src/bin/lttng-sessiond/ust-app.h @@ -24,7 +24,8 @@ #include "trace-ust.h" /* lttng-ust supported version. */ -#define UST_APP_MAJOR_VERSION 1 +#define LTTNG_UST_COMM_MAJOR 2 /* comm protocol major version */ +#define UST_APP_MAJOR_VERSION 2 /* UST version supported */ #define UST_APP_EVENT_LIST_SIZE 32