[Unison-hackers] [unison-users] Address family not supported by protocol [socket()]

Samuel Thibault samuel.thibault at ens-lyon.org
Sat Oct 1 11:03:54 EDT 2005


Hi,

Jerome Vouillon, le Sat 01 Oct 2005 16:43:34 +0200, a écrit :
> Hi Chuck,
> 
> On Sat, Oct 01, 2005 at 10:30:16AM -0400, Chuck Farley wrote:
> > I'm using unison-2.17.1-linux-text.  Which I only just
> > realized is a BETA.  Damn never noticed that.  Will
> > try the latest stable.
> [...]
> > strace unison -socket 9876
> [...]
> > socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = -1
> 
> So, this is due to the IPV6 support code which was recently added to
> Unison.  The latest stable version should not have this problem.

Indeed.

I'm afraid I missed the whole bug report, but I guess Chuck complains
about a spurious warning to be emitted. That warning is a bit useless
indeed, here is a patch:

--- remote-orig.ml	2005-10-01 16:55:40.000000000 +0200
+++ remote.ml	2005-10-01 16:59:28.000000000 +0200
@@ -824,9 +824,10 @@
         Unix.connect socket ai.Unix.ai_addr;
         initConnection socket socket
       with
-        Unix.Unix_error (_, _, reason) ->
-          (Util.warn
-            (Printf.sprintf
+        Unix.Unix_error (error, _, reason) ->
+          (if error != Unix.EAFNOSUPPORT then
+            Util.warn
+              (Printf.sprintf
                     "Can't connect to server (%s:%s): %s" host port reason);
            loop r)
     end
@@ -1137,11 +1138,12 @@
           Unix.listen socket 1;
 	  socket
 	with
-	  Unix.Unix_error (_, _, reason) ->
-            (Util.warn
-               (Printf.sprintf
-                  "Can't bind to host (%s:%s): %s" ai.Unix.ai_canonname port
-		  reason);
+	  Unix.Unix_error (error, _, reason) ->
+            (if error != Unix.EAFNOSUPPORT then
+               Util.warn
+                 (Printf.sprintf
+                    "Can't bind to host (%s:%s): %s" ai.Unix.ai_canonname port
+		    reason);
 	     loop r)
 	end in
       let listening = loop (Unix.getaddrinfo host port [ Unix.AI_SOCKTYPE


More information about the Unison-hackers mailing list