From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: sockets availability during build Date: Fri, 23 Jan 2015 22:31:16 +0100 Message-ID: <87d265rxp7.fsf@gnu.org> References: <87zj99x561.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YElp6-00017e-50 for guix-devel@gnu.org; Fri, 23 Jan 2015 16:31:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YElp1-0004Qp-1u for guix-devel@gnu.org; Fri, 23 Jan 2015 16:31:24 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YElp0-0004Ql-Vk for guix-devel@gnu.org; Fri, 23 Jan 2015 16:31:19 -0500 In-Reply-To: (Federico Beffa's message of "Fri, 23 Jan 2015 18:37:04 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Federico Beffa Cc: Guix-devel Federico Beffa skribis: > The error is produced by the system call "setsockopt". Here is the > part of the strace log showing the error: [...] > socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) =3D 9 > setsockopt(9, SOL_IP, IP_MULTICAST_TTL, "\4", 1) =3D 0 > fcntl(9, F_GETFL) =3D 0x2 (flags O_RDWR) > fcntl(9, F_SETFL, O_RDWR|O_NONBLOCK) =3D 0 > socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) =3D 10 > setsockopt(10, SOL_SOCKET, SO_REUSEADDR, [1], 4) =3D 0 > bind(10, {sa_family=3DAF_INET, sin_port=3Dhtons(1900), > sin_addr=3Dinet_addr("0.0.0.0")}, 16) =3D 0 > setsockopt(10, SOL_IP, IP_ADD_MEMBERSHIP, "\357\377\377\372\0\0\0\0", > 8) =3D -1 ENODEV (No such device) [...] > From the above I understand that libupnp embedded server wants to > setup multicast, but, as far as I know, this doesn't work with the > "lo" interface and fails. I do not see a workaround. Anyone? Yeah suggests that ENODEV is due to the lack of a default route. Indeed, running that fails: --8<---------------cut here---------------start------------->8--- (use-modules (guix)) (define build #~(begin (define %upnp-ipv4-multicast-address (inet-pton AF_INET "239.255.255.250")) (define %upnp-multicast-port 1900) (define %upnp-ipv4-multicast-socket-address (make-socket-address AF_INET %upnp-ipv4-multicast-address %upnp-multicast-port)) (define (open-upnp-socket) (let ((s (socket PF_INET SOCK_DGRAM 0))) (setsockopt s IPPROTO_IP IP_ADD_MEMBERSHIP (cons %upnp-ipv4-multicast-address INADDR_ANY)) s)) (pk (open-upnp-socket)) (flush-all-ports) (mkdir #$output))) (with-store store (run-with-store store (mlet %store-monad ((drv (gexp->derivation "test" build))) (built-derivations (list drv))))) --8<---------------cut here---------------end--------------->8--- If we add, before the =E2=80=98open-upnp-socket=E2=80=99 call, this line: --8<---------------cut here---------------start------------->8--- (system* (string-append #$net-tools "/sbin/route") "add" "-net" "default") --8<---------------cut here---------------end--------------->8--- =E2=80=98route=E2=80=99 simply fails with: SIOCADDRT: Operation not permitted I don=E2=80=99t know how to work around it. You may need to disable the te= sts. Thanks, Ludo=E2=80=99.