I have an armv6j (RPi) system using uClibc. It has always had IPv6 turned off (both in uClibc, and in the kernel). Trying to upgrade it today from openssl-1.0.1h-r1 to openssl-1.0.1i, results in undeclared IPV6_V6ONLY and in6addr_any errors. I'll attach the build log. Reproducible: Always
Created attachment 384156 [details] failed build.log
The unsupported ioctl's are because I am compiling inside of a qemu chroot
The offending code in s_socket.c is around line 401: #if OPENSSL_USE_IPV6 if ((use_ipv4 == 0) && (use_ipv6 == 1)) { const int on = 1; setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (const void *) &on, sizeof(int)); } #endif and line 429 #if OPENSSL_USE_IPV6 else { addr_len = (socklen_t)sizeof(struct sockaddr_in6); memset(server_in6, 0, sizeof(struct sockaddr_in6)); server_in6->sin6_family = AF_INET6; server_in6->sin6_port = htons((unsigned short)port); if (ip == NULL) server_in6->sin6_addr = in6addr_any; else memcpy(&server_in6->sin6_addr, ip, sizeof(struct in6_addr)); } #endif But I don't understand why you get there, because of the #if's. There is another problem though. There is a bad patch on s_socket.c. Looks like this patch is going to need some work. yellow openssl-1.0.1i # patch -p1 < /usr/portage/dev-libs/openssl/files/openssl-1.0.1h-ipv6.patch patching file apps/s_apps.h patching file apps/s_client.c Hunk #2 succeeded at 574 (offset 2 lines). Hunk #3 succeeded at 620 (offset 2 lines). Hunk #4 succeeded at 639 (offset 2 lines). Hunk #5 succeeded at 966 (offset 2 lines). Hunk #6 succeeded at 1289 (offset 2 lines). Hunk #7 succeeded at 1315 (offset 2 lines). patching file apps/s_server.c Hunk #1 succeeded at 562 with fuzz 1 (offset 2 lines). Hunk #2 succeeded at 957 (offset 6 lines). Hunk #3 succeeded at 986 (offset 6 lines). Hunk #4 succeeded at 1340 (offset 6 lines). Hunk #5 succeeded at 1918 (offset 14 lines). patching file apps/s_socket.c patching file apps/s_socket.c.rej
Okay a few points: 1) the above broken patch is not the culprit, but still a problem 2) this is arch independant, i hit it on i686 3) e_os.h is braindead. It defines OPENSSL_USE_IPV6 in e_os.h around line 632 as # if !defined(OPENSSL_USE_IPV6) # if defined(AF_INET6) && !defined(OPENSSL_SYS_BEOS_BONE) && !defined(NETWARE_CLIB) # define OPENSSL_USE_IPV6 1 # else # define OPENSSL_USE_IPV6 0 # endif # endif So we end up defining OPENSSL_USE_IPV6 1 because AF_INET6 is defined even if we build uclibc with UCLIBC_HAS_IPV6 unset. I really don't want to add a USE=ipv6 flag to the ebuild. Let me think about how to fix this right.
sys-libs/uclibc has been removed from the tree, replaced by sys-libs/uclibc-ng. if this is still a problem on uclibc-ng, please open a new bug.