X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Finet6.c;h=9eab3fa2fe7e15bc0c5d6d1417bc7f96d2150cbf;hb=669d25b6d224253699e8521fbd7f50d3187b238e;hp=52e2f8e5853d9abdb6b6bc059998fb8a92e3057c;hpb=a655f4cf59f557aef3f0a975988d87bdd3b199fd;p=lttng-tools.git diff --git a/src/common/sessiond-comm/inet6.c b/src/common/sessiond-comm/inet6.c index 52e2f8e58..9eab3fa2f 100644 --- a/src/common/sessiond-comm/inet6.c +++ b/src/common/sessiond-comm/inet6.c @@ -16,6 +16,7 @@ */ #define _GNU_SOURCE +#define _LGPL_SOURCE #include #include #include @@ -57,6 +58,7 @@ LTTNG_HIDDEN int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto) { int val = 1, ret; + unsigned long timeout; /* Create server socket */ if ((sock->fd = socket(PF_INET6, type, proto)) < 0) { @@ -74,6 +76,17 @@ int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto) PERROR("setsockopt inet6"); goto error; } + timeout = lttcomm_get_network_timeout(); + if (timeout) { + ret = lttcomm_setsockopt_rcv_timeout(sock->fd, timeout); + if (ret) { + goto error; + } + ret = lttcomm_setsockopt_snd_timeout(sock->fd, timeout); + if (ret) { + goto error; + } + } return 0;