Signed-off-by: David Goulet <dgoulet@efficios.com>
struct lttcomm_sock *lttcomm_accept_inet_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) {
goto error;
}
+ len = sizeof(new_sock->sockaddr.addr.sin);
+
/* Blocking call */
new_fd = accept(sock->fd, (struct sockaddr *) &new_sock->sockaddr.addr.sin,
&len);
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) {
goto error;
}
+ len = sizeof(new_sock->sockaddr.addr.sin6);
+
/* Blocking call */
new_fd = accept(sock->fd,
(struct sockaddr *) &new_sock->sockaddr.addr.sin6, &len);