Using -C and -D with lttng create, the session if first created with the
default file path and then changed to the relayd URIs.
The destination object was not reset which was causing a corruption to
the state of the consumer object.
Signed-off-by: David Goulet <dgoulet@efficios.com>
case LTTNG_DST_IPV6:
DBG2("Setting network URI to consumer");
case LTTNG_DST_IPV6:
DBG2("Setting network URI to consumer");
- consumer->type = CONSUMER_DST_NET;
-
- if ((uri->stype == LTTNG_STREAM_CONTROL &&
+ if (consumer->type == CONSUMER_DST_NET) {
+ if ((uri->stype == LTTNG_STREAM_CONTROL &&
consumer->dst.net.control_isset) ||
(uri->stype == LTTNG_STREAM_DATA &&
consumer->dst.net.data_isset)) {
consumer->dst.net.control_isset) ||
(uri->stype == LTTNG_STREAM_DATA &&
consumer->dst.net.data_isset)) {
- ret = LTTNG_ERR_URL_EXIST;
- goto error;
+ ret = LTTNG_ERR_URL_EXIST;
+ goto error;
+ }
+ } else {
+ memset(&consumer->dst.net, 0, sizeof(consumer->dst.net));
+ consumer->type = CONSUMER_DST_NET;
+
/* Set URI into consumer output object */
ret = consumer_set_network_uri(consumer, uri);
if (ret < 0) {
/* Set URI into consumer output object */
ret = consumer_set_network_uri(consumer, uri);
if (ret < 0) {