Verify UST comm proto version
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Feb 2012 16:41:58 +0000 (11:41 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 2 Feb 2012 16:41:58 +0000 (11:41 -0500)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
src/bin/lttng-sessiond/ust-app.c
src/bin/lttng-sessiond/ust-app.h

index 77888048794c39d2cdd329122eccb3af633da39f..2b66b92c07d5e4b41043256c9a2695d0080f6746 100644 (file)
@@ -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");
index 0fb854fbe4d2ffb1c1628987743c9d8ba9278e36..5bfecdb47deb0a8e2b2be9d872a5072f286cba3b 100644 (file)
@@ -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
 
This page took 0.029 seconds and 5 git commands to generate.