Agent: Make the agent protocol consistently network endian
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 23 Oct 2015 21:14:55 +0000 (17:14 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 23 Oct 2015 21:14:55 +0000 (17:14 -0400)
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 <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/agent.c

index 5baa0fa0c6fe99d303f47327f52cac3ecf8284ea..f6f2f772e08af693c26268e10b0dfda5bed08d09 100644 (file)
@@ -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) {
This page took 0.026017 seconds and 4 git commands to generate.