X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fmain.c;h=bd19a323715309697ba3b3ff61c6d29a615ad379;hp=a00fb3c48ab258459de880d3a4720ef9dfd9b0ed;hb=092b625914723e40ccb3345826a2280cbd01f8b8;hpb=f66c074ce00abc984ec7cb57a4fa31b1d9cffd72 diff --git a/src/bin/lttng-relayd/main.c b/src/bin/lttng-relayd/main.c index a00fb3c48..bd19a3237 100644 --- a/src/bin/lttng-relayd/main.c +++ b/src/bin/lttng-relayd/main.c @@ -1281,7 +1281,7 @@ int relay_send_version(struct lttcomm_relayd_hdr *recv_hdr, struct relay_command *cmd) { int ret; - struct lttcomm_relayd_version reply; + struct lttcomm_relayd_version reply, msg; struct relay_session *session; if (cmd->session == NULL) { @@ -1299,6 +1299,21 @@ int relay_send_version(struct lttcomm_relayd_hdr *recv_hdr, } session->version_check_done = 1; + /* Get version from the other side. */ + ret = cmd->sock->ops->recvmsg(cmd->sock, &msg, sizeof(msg), MSG_WAITALL); + if (ret < 0 || ret != sizeof(msg)) { + ret = -1; + ERR("Relay failed to receive the version values."); + goto end; + } + + /* + * For now, we just ignore the received version but after 2.1 stable + * release, a check must be done to see if we either adapt to the other + * side version (which MUST be lower than us) or keep the latest data + * structure considering that the other side will adapt. + */ + ret = sscanf(VERSION, "%u.%u", &reply.major, &reply.minor); if (ret < 2) { ERR("Error in scanning version");