Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
be64toh(connect.viewer_session_id));
printf_verbose("Relayd version : %u.%u\n", be32toh(connect.major),
be32toh(connect.minor));
be64toh(connect.viewer_session_id));
printf_verbose("Relayd version : %u.%u\n", be32toh(connect.major),
be32toh(connect.minor));
+
+ if (LTTNG_LIVE_MAJOR != be32toh(connect.major)) {
+ fprintf(stderr, "[error] Incompatible lttng-relayd protocol\n");
+ goto error;
+ }
+ /* Use the smallest protocol version implemented. */
+ if (LTTNG_LIVE_MINOR > be32toh(connect.minor)) {
+ ctx->minor = be32toh(connect.minor);
+ } else {
+ ctx->minor = LTTNG_LIVE_MINOR;
+ }
+ ctx->major = LTTNG_LIVE_MAJOR;
ret = 0;
end:
return ret;
ret = 0;
end:
return ret;
char relay_hostname[NAME_MAX];
int control_sock;
int port;
char relay_hostname[NAME_MAX];
int control_sock;
int port;
+ /* Protocol version to use for this connection. */
+ uint32_t major;
+ uint32_t minor;
struct lttng_live_session *session;
struct bt_context *bt_ctx;
GArray *session_ids;
struct lttng_live_session *session;
struct bt_context *bt_ctx;
GArray *session_ids;