X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Fsessiond-comm%2Finet6.c;h=024beace3bed4ff8dc704936317ebc546540a1b9;hb=88a5db7000bfa9a29be7e843e580aae64e9e7b95;hp=98aba04306d6dea93020fde056e620f5df5f4fdf;hpb=7b43086dc8feb11d94e14b73db197eb178be7b50;p=lttng-tools.git diff --git a/src/common/sessiond-comm/inet6.c b/src/common/sessiond-comm/inet6.c index 98aba0430..024beace3 100644 --- a/src/common/sessiond-comm/inet6.c +++ b/src/common/sessiond-comm/inet6.c @@ -47,6 +47,7 @@ static const struct lttcomm_proto_ops inet6_ops = { /* * Creates an PF_INET socket. */ +__attribute__((visibility("hidden"))) int lttcomm_create_inet6_sock(struct lttcomm_sock *sock, int type, int proto) { int val = 1, ret; @@ -77,6 +78,7 @@ error: /* * Bind socket and return. */ +__attribute__((visibility("hidden"))) int lttcomm_bind_inet6_sock(struct lttcomm_sock *sock) { int ret; @@ -93,6 +95,7 @@ int lttcomm_bind_inet6_sock(struct lttcomm_sock *sock) /* * Connect PF_INET socket. */ +__attribute__((visibility("hidden"))) int lttcomm_connect_inet6_sock(struct lttcomm_sock *sock) { int ret, closeret; @@ -122,10 +125,11 @@ error_connect: * Do an accept(2) on the sock and return the new lttcomm socket. The socket * MUST be bind(2) before. */ +__attribute__((visibility("hidden"))) struct lttcomm_sock *lttcomm_accept_inet6_sock(struct lttcomm_sock *sock) { int new_fd; - socklen_t len = 0; + socklen_t len; struct lttcomm_sock *new_sock; if (sock->proto == LTTCOMM_SOCK_UDP) { @@ -141,6 +145,8 @@ struct lttcomm_sock *lttcomm_accept_inet6_sock(struct lttcomm_sock *sock) goto error; } + len = sizeof(new_sock->sockaddr.addr.sin6); + /* Blocking call */ new_fd = accept(sock->fd, (struct sockaddr *) &new_sock->sockaddr.addr.sin6, &len); @@ -163,6 +169,7 @@ error: /* * Make the socket listen using LTTNG_SESSIOND_COMM_MAX_LISTEN. */ +__attribute__((visibility("hidden"))) int lttcomm_listen_inet6_sock(struct lttcomm_sock *sock, int backlog) { int ret; @@ -193,6 +200,7 @@ end: * * Return the size of received data. */ +__attribute__((visibility("hidden"))) ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf, size_t len, int flags) { @@ -229,6 +237,7 @@ ssize_t lttcomm_recvmsg_inet6_sock(struct lttcomm_sock *sock, void *buf, * * Return the size of sent data. */ +__attribute__((visibility("hidden"))) ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, void *buf, size_t len, int flags) { @@ -271,6 +280,7 @@ ssize_t lttcomm_sendmsg_inet6_sock(struct lttcomm_sock *sock, void *buf, /* * Shutdown cleanly and close. */ +__attribute__((visibility("hidden"))) int lttcomm_close_inet6_sock(struct lttcomm_sock *sock) { int ret;