Package: libupnp Version: 1:1.6.17-1 Severity: important Tags: patch User: debian-h...@lists.debian.org Usertags: hurd
Hi, currently[1], libupnp 1.6.17 fails to build on GNU/Hurd. The problem is that in upnp/src/ssdp/ssdp_server.c, inside create_ssdp_sock_v4(), create_ssdp_sock_v6() and create_ssdp_sock_v6_ula_gua() there's a setsockopt() to enable the SO_REUSEPORT option, which is not supported on Hurd (the code gets enabled because GNU libc on Hurd defines BSD, since in the past it strived to get some compatibility with it). Patch (hurd-sockopt.diff) attached for it. Also, attached patch hurd-pthread.diff to avoid a compiling warning, due to a (wrong) redefinition of PTHREAD_MUTEX_RECURSIVE_NP. [1] https://buildd.debian.org/status/fetch.php?pkg=libupnp&arch=hurd-i386&ver=1%3A1.6.17-1&stamp=1335282851 Thanks, -- Pino
--- a/upnp/src/ssdp/ssdp_server.c +++ b/upnp/src/ssdp/ssdp_server.c @@ -812,7 +812,7 @@ static int create_ssdp_sock_v4( ret = UPNP_E_SOCKET_ERROR; goto error_handler; } -#if defined(BSD) || defined(__OSX__) || defined(__APPLE__) +#if (defined(BSD) && !defined(__GNU__)) || defined(__OSX__) || defined(__APPLE__) onOff = 1; ret = setsockopt(*ssdpSock, SOL_SOCKET, SO_REUSEPORT, (char *)&onOff, sizeof(onOff)); @@ -954,7 +954,7 @@ static int create_ssdp_sock_v6( ret = UPNP_E_SOCKET_ERROR; goto error_handler; } -#if defined(BSD) || defined(__OSX__) || defined(__APPLE__) +#if (defined(BSD) && !defined(__GNU__)) || defined(__OSX__) || defined(__APPLE__) onOff = 1; ret = setsockopt(*ssdpSock, SOL_SOCKET, SO_REUSEPORT, (char *)&onOff, sizeof(onOff)); @@ -1067,7 +1067,7 @@ static int create_ssdp_sock_v6_ula_gua( ret = UPNP_E_SOCKET_ERROR; goto error_handler; } -#if defined(BSD) || defined(__OSX__) || defined(__APPLE__) +#if (defined(BSD) && !defined(__GNU__)) || defined(__OSX__) || defined(__APPLE__) onOff = 1; ret = setsockopt(*ssdpSock, SOL_SOCKET, SO_REUSEPORT, (char *)&onOff, sizeof(onOff));
--- a/threadutil/inc/ithread.h +++ b/threadutil/inc/ithread.h @@ -50,7 +50,7 @@ extern "C" { #include <pthread.h> -#if defined(BSD) +#if defined(BSD) && !defined(__GNU__) #define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE #endif