diff --git a/Pal/src/host/Linux-SGX/sgx_enclave.c b/Pal/src/host/Linux-SGX/sgx_enclave.c index abd57495..080c8c15 100644 --- a/Pal/src/host/Linux-SGX/sgx_enclave.c +++ b/Pal/src/host/Linux-SGX/sgx_enclave.c @@ -290,11 +290,7 @@ static int sgx_ocall_listen(void * pms) goto err; fd = ret; - if (ms->ms_addr->sa_family == AF_INET6) { - int ipv6only = 1; - INLINE_SYSCALL(setsockopt, 5, fd, SOL_IPV6, IPV6_V6ONLY, &ipv6only, - sizeof(int)); - } + /* must set the socket to be reuseable */ int reuseaddr = 1; INLINE_SYSCALL(setsockopt, 5, fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, @@ -369,11 +365,6 @@ static int sgx_ocall_connect(void * pms) goto err; fd = ret; - if (ms->ms_addr && ms->ms_addr->sa_family == AF_INET6) { - int ipv6only = 1; - INLINE_SYSCALL(setsockopt, 5, fd, SOL_IPV6, IPV6_V6ONLY, &ipv6only, - sizeof(int)); - } if (ms->ms_bind_addr && ms->ms_bind_addr->sa_family) { ret = INLINE_SYSCALL(bind, 3, fd, ms->ms_bind_addr, diff --git a/Pal/src/host/Linux/db_sockets.c b/Pal/src/host/Linux/db_sockets.c index f40d7b7b..f101ef90 100644 --- a/Pal/src/host/Linux/db_sockets.c +++ b/Pal/src/host/Linux/db_sockets.c @@ -348,11 +348,6 @@ static int tcp_listen(PAL_HANDLE* handle, char* uri, int options) { if (IS_ERR(fd)) return -PAL_ERROR_DENIED; - if (bind_addr->sa_family == AF_INET6) { - int ipv6only = 1; - INLINE_SYSCALL(setsockopt, 5, fd, SOL_IPV6, IPV6_V6ONLY, &ipv6only, sizeof(int)); - } - /* must set the socket to be reuseable */ int reuseaddr = 1; INLINE_SYSCALL(setsockopt, 5, fd, SOL_SOCKET, SO_REUSEADDR, &reuseaddr, sizeof(int)); @@ -480,11 +475,6 @@ static int tcp_connect(PAL_HANDLE* handle, char* uri, int options) { } } - if (dest_addr->sa_family == AF_INET6) { - int ipv6only = 1; - INLINE_SYSCALL(setsockopt, 5, fd, SOL_IPV6, IPV6_V6ONLY, &ipv6only, sizeof(int)); - } - ret = INLINE_SYSCALL(connect, 3, fd, dest_addr, dest_addrlen); if (IS_ERR(ret) && ERRNO(ret) == EINPROGRESS) { @@ -635,11 +625,6 @@ static int udp_bind(PAL_HANDLE* handle, char* uri, int options) { if (IS_ERR(fd)) return -PAL_ERROR_DENIED; - if (bind_addr->sa_family == AF_INET6) { - int ipv6only = 1; - INLINE_SYSCALL(setsockopt, 5, fd, SOL_IPV6, IPV6_V6ONLY, &ipv6only, sizeof(int)); - } - ret = INLINE_SYSCALL(bind, 3, fd, bind_addr, bind_addrlen); if (IS_ERR(ret)) { @@ -694,11 +679,6 @@ static int udp_connect(PAL_HANDLE* handle, char* uri, int options) { if (IS_ERR(fd)) return -PAL_ERROR_DENIED; - if (dest_addr && dest_addr->sa_family == AF_INET6) { - int ipv6only = 1; - INLINE_SYSCALL(setsockopt, 5, fd, SOL_IPV6, IPV6_V6ONLY, &ipv6only, sizeof(int)); - } - if (bind_addr) { ret = INLINE_SYSCALL(bind, 3, fd, bind_addr, bind_addrlen);