sessiond: fix: possible unaligned access in packed structure
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Sat, 14 Sep 2019 19:58:17 +0000 (15:58 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 19:31:48 +0000 (15:31 -0400)
Use a temporary relayd_session_id variable to prevent an unaligned
access in the packed communication structure 'msg'.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c

index 53f7c3946e859fd6c1c4a7581db12415ba5f8121..46ee31cc28bfc2b7026f03e9ceb4faa7c576c4e9 100644 (file)
@@ -1151,9 +1151,10 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock,
 
        if (type == LTTNG_STREAM_CONTROL) {
                char output_path[LTTNG_PATH_MAX] = {};
+               uint64_t relayd_session_id;
 
                ret = relayd_create_session(rsock,
-                               &msg.u.relayd_sock.relayd_session_id,
+                               &relayd_session_id,
                                session_name, hostname, base_path,
                                session_live_timer,
                                consumer->snapshot, session_id,
@@ -1166,6 +1167,7 @@ int consumer_send_relayd_socket(struct consumer_socket *consumer_sock,
                        (void) relayd_close(rsock);
                        goto error;
                }
+               msg.u.relayd_sock.relayd_session_id = relayd_session_id;
                DBG("Created session on relay, output path reply: %s",
                        output_path);
        }
This page took 0.026961 seconds and 4 git commands to generate.