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:14:52 +0000 (14:14 -0400)
commit92d3cba45e0f6ffd5d81bbba7b2d7011b0b18de1
tree49dadda9765014076c1abcd5585c3b81fdf0fbf1
parentb2be0f7bf1550b80316ec3703dbd9effdb1759dd
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.024421 seconds and 4 git commands to generate.