From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id E1BCABC69 for ; Sun, 6 May 2007 12:05:04 +0200 (CEST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.179]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l46A54vk008636 for ; Sun, 6 May 2007 12:05:04 +0200 Received: from [84.59.110.99] (helo=gate.lan.gerd-stolpmann.de) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1Hkdbz47MO-0004II; Sun, 06 May 2007 12:05:04 +0200 Received: from flakew.lan.gerd-stolpmann.de (fw.lan.gerd-stolpmann.de [192.168.1.1]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id A43D0C094; Sun, 6 May 2007 12:05:03 +0200 (CEST) Subject: Re: [Caml-list] Solved! (was Re: Mac OSX getsocketpair/getsockname and IPv6) From: Gerd Stolpmann To: Joel Reymont Cc: OCaml List In-Reply-To: <6AC4F0FE-E2D1-4EDD-87A5-2FA3CBB0FBBE@gmail.com> References: <71B2C4B5-3ECB-450F-B015-3C5EAB90855F@gmail.com> <75F71DDF-CACC-4AD9-A3DA-E0049FC9FB2F@gmail.com> <6AC4F0FE-E2D1-4EDD-87A5-2FA3CBB0FBBE@gmail.com> Content-Type: text/plain Date: Sun, 06 May 2007 12:05:02 +0200 Message-Id: <1178445903.17865.25.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX1+3VhmT/jTnQLWQ/S2ahhdpUDCHq5ZyLc1M1xX uw4qrdiOX33hptRQ0x6TYjRCrJrmIHo65xtWIRhikW7lkiRLAV sqUT4/MpWI3e1rQ1TH33YfZ/Tp/OHlk X-Miltered: at discorde with ID 463DA850.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; osx:01 getsockname:01 gerd:01 stolpmann:01 alloc:01 sockaddr:01 usr:01 alloc:01 sockaddr:01 ocamlnet:01 ocaml:01 getsockname:01 getpeername:01 gerd:01 stolpmann:01 Am Samstag, den 05.05.2007, 16:16 +0100 schrieb Joel Reymont: > The culprit is in alloc_sockaddr [1]. > > adr->s_gen.sa_family is 0 which stands for AF_UNSPEC in my /usr/ > include/sys/socket.h. > > alloc_sockaddr does not handle this family type and throws EAFNOSUPPORT. > > I'm inclined to think that ocamlnet should be fixed and not the OCaml > library, although it would be helpful if an error different from > EAFNOSUPPORT was used. Yes, this is true, EAFNOSUPPORT is misleading because it means that the whole address family is not supported. A better code would be EOPNOTSUPP which is generally used when a certain socket operation cannot be performed for the type of socket (and the Single Unix Spec documents it for getsockname/getpeername). Or Unix.sockaddr is extended by an extra case for the inaccessible address. > default: > if (close_on_error != -1) close (close_on_error); > unix_error(EAFNOSUPPORT, "", Nothing); > } Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------