From 7dfb68b50a6a34edabbd6cdca39615df310cc0a1 Mon Sep 17 00:00:00 2001 From: Vincent Bernardoff Date: Mon, 10 Oct 2016 19:11:59 +0200 Subject: [PATCH] create correct socket family given ip addr type --- src/node/net/p2p.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node/net/p2p.ml b/src/node/net/p2p.ml index 06c2e5388..6ed796845 100644 --- a/src/node/net/p2p.ml +++ b/src/node/net/p2p.ml @@ -762,7 +762,7 @@ let bootstrap config limits = | _, [] -> return false (* we didn't manage to contact enough peers *) | nb, ((addr, port), gid, source) :: tl -> (* we try to open a connection *) - let socket = LU.(socket PF_INET6 SOCK_STREAM 0) in + let socket = LU.(socket (match addr with Ipaddr.V4 _ -> PF_INET | V6 _ -> PF_INET6) SOCK_STREAM 0) in let uaddr = Ipaddr_unix.to_inet_addr addr in catch (fun () ->