Fix: lttng-ust control protocol handling of variable length command data
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 13 May 2021 14:02:42 +0000 (10:02 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 14 May 2021 18:15:56 +0000 (14:15 -0400)
commit662d05907560345f06a19463ce5bf24ca72a442c
tree49dadda9765014076c1abcd5585c3b81fdf0fbf1
parentea1c5d69f941ccd8427feb2f1082fd3d4e867b0f
Fix: lttng-ust control protocol handling of variable length command data

The scheme for sending variable length data and file descriptors after
the command message causes irrecoverable "unknown commands" errors when
communicating with older versions of lttng-ust, because the receiver
(lttng-ust in applications) does not know that it needs to consume the
variable length data on the communication socket.

For the new commands introduced in the 2.13 cycle, we can change the
protocol on both ends (liblttng-ust-ctl and liblttng-ust) now to add
a reply to the fixed-size part of the command before sending the
variable length data and file descriptors.

For pre-existing commands sending variable length data and file
descriptors right after the fixed-size command, handle this
irrecoverable "unknown command" error by doing a socket shutdown from
liblttng-ust-ctl.

Also document the protocol for each command sending variable length data
and file descriptors after the fixed-size command structure.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: If048c739dd37147ffb2a54715c2101177d2df4f7
src/lib/lttng-ust-ctl/ustctl.c
src/lib/lttng-ust/lttng-ust-comm.c
This page took 0.025655 seconds and 4 git commands to generate.