sks-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Sks-devel] [PATCH] IPv6 support


From: Phil Pennock
Subject: Re: [Sks-devel] [PATCH] IPv6 support
Date: Fri, 6 Mar 2009 23:53:38 -0800

On 2009-03-06 at 23:06 -0500, Yaron Minsky wrote:
>    - Cleaned up the way that IPv4 and IPv6 logic was chosen in the code so
>    as to reduce boilerplate

"let foo = bar in" in the middle of a list.  I have a lot to learn.  ;)

>    - Got rid of incorrect use of ==.  In OCaml, == is physical equality,
>    whereas = is ordinary structural equality.

I discovered this at some point while writing the patch and thought I'd
cleaned things up; I think I left == only on things like character
tests, for which pervasives.mli documented == as identitcal to =.  I
guess it's better to just get in the habit of always using =, since they
are identical.

>    - streamlined some repetitive code in membership.ml

I had somehow missed 'a option and Some; I just had an O'Caml-speaker
explain it to me.  *sigh*  I so wish I'd known about Some at the time.

>    - other minor tweaks
>    - Defined the |! operator (used for creating function pipelines) and used
>    that to make the code more readable in a few spots.

Nice.

So, is there an easy way to detect from OCaml if there's a routable IPv6
service available, or should we provide knobs to disable IPv4 or IPv6?

In C, I'd use
  addrinfo_obj.ai_flags |= AI_ADDRCONFIG
for the getaddrinfo() call, so that addresses are only returned for
those address families for which such an address is configured on the
local system.  I couldn't see a way to do that in O'Caml.  I'm running
3.10.2 (FreeBSD port, ocaml-notk-3.10.2_1) and the socket handling in
unix.mli leaves somewhat to be desired, both in setsockopt for anything
other than socket-level options and flags for some of the newer
interfaces such as getaddrinfo().  :-/

-Phil

Attachment: pgpl5gRPM5EDj.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]