Fix: consumer: 64-bit index for relayd rather than 32-bit (v2)
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 28 Jun 2013 15:26:04 +0000 (11:26 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Fri, 28 Jun 2013 15:43:15 +0000 (11:43 -0400)
commit98cf381a6490116f27ed9d2de552c146339f8405
tree18d13f8a53be5519b8a2675d02bd3e488b1f3df5
parentcb7c69091edf2394fc8a338c6e4dc504afd48844
Fix: consumer: 64-bit index for relayd rather than 32-bit (v2)

Relayd "unique" ids wrap every 32-bit, and in some cases, negative
values are considered as error.

Change this to make the error value specifically -1ULL, use a direct
comparison (since we use an unsigned 64-bit integer, comparison with 0
becomes incorrect).

Since we now use a 64-bit ID, it is assumed to _never_ wrap-around
(remember, value -1ULL is an _error_). Therefore,
consumer_add_relayd_socket() can become much more strict than it was:
instead of accepting re-use of net_seq_idx, we can now assert that upon
LTTNG_STREAM_CONTROL socket, we have indeed allocated a relayd object,
and upon LTTNG_STREAM_DATA, we have found a relayd object.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer.c
src/common/consumer.h
src/common/ust-consumer/ust-consumer.c
This page took 0.025228 seconds and 4 git commands to generate.