X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fsessiond-comm%2Finet6.c;h=5b137c4eb3a73430ad364b9e9acacce4f6126d3b;hb=783a3b9aa609d6805e1463655d25c7ae176c4859;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..5b137c4eb 100644 --- a/src/common/sessiond-comm/inet6.c +++ b/src/common/sessiond-comm/inet6.c @@ -57,6 +57,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 +75,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;