From a9bfd666af51ddac021f2b0f836b32cb194cc847 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 23 Oct 2015 17:14:55 -0400 Subject: [PATCH] Agent: Make the agent protocol consistently network endian MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Considering the Agent Protocol is bumped to v2.0 as of 2.8.x, this patch revisits the unfortunate decision of communicating in host-endianness from the session daemon to the agents, and in big endian from the agents to the session daemon. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/agent.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bin/lttng-sessiond/agent.c b/src/bin/lttng-sessiond/agent.c index 5baa0fa0c..f6f2f772e 100644 --- a/src/bin/lttng-sessiond/agent.c +++ b/src/bin/lttng-sessiond/agent.c @@ -398,10 +398,10 @@ static int enable_event(struct agent_app *app, struct agent_event *event) } memset(&msg, 0, sizeof(msg)); - msg.loglevel_value = event->loglevel_value; - msg.loglevel_type = event->loglevel_type; + msg.loglevel_value = htobe32(event->loglevel_value); + msg.loglevel_type = htobe32(event->loglevel_type); strncpy(msg.name, event->name, sizeof(msg.name)); - msg.filter_expression_length = filter_expression_length; + msg.filter_expression_length = htobe32(filter_expression_length); bytes_to_send = zmalloc(data_size); if (!bytes_to_send) { -- 2.34.1