diff --git a/librb/src/commio.c b/librb/src/commio.c index 945c0a77..f8bd8fa5 100644 --- a/librb/src/commio.c +++ b/librb/src/commio.c @@ -346,11 +346,14 @@ rb_accept_tryaccept(rb_fde_t *F, void *data) { struct rb_sockaddr_storage st; rb_fde_t *new_F; - rb_socklen_t addrlen = sizeof(st); + rb_socklen_t addrlen; int new_fd; while(1) { + memset(&st, 0, sizeof(st)); + addrlen = sizeof(st); + new_fd = accept(F->fd, (struct sockaddr *)&st, &addrlen); rb_get_errno(); if(new_fd < 0) @@ -752,9 +755,6 @@ mangle_mapped_sockaddr(struct sockaddr *in) { struct sockaddr_in6 *in6 = (struct sockaddr_in6 *)in; - if(in->sa_family == AF_INET) - return; - if(in->sa_family == AF_INET6 && IN6_IS_ADDR_V4MAPPED(&in6->sin6_addr)) { struct sockaddr_in in4; @@ -764,7 +764,6 @@ mangle_mapped_sockaddr(struct sockaddr *in) in4.sin_addr.s_addr = ((uint32_t *)&in6->sin6_addr)[3]; memcpy(in, &in4, sizeof(struct sockaddr_in)); } - return; } #endif