From: Jérémie Galarneau Date: Fri, 23 Oct 2015 21:14:55 +0000 (-0400) Subject: Agent: Make the agent protocol consistently network endian X-Git-Tag: v2.8.0-rc1~240 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=a9bfd666af51ddac021f2b0f836b32cb194cc847;p=lttng-tools.git Agent: Make the agent protocol consistently network endian 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 --- 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) {