--- a/src/socketlib.c	2012-07-14 22:49:30.000000000 +0200
+++ b/src/socketlib.c	2012-10-08 21:55:51.000000000 +0200
@@ -118,6 +118,7 @@
 
   int tEnable = 1;
   setsockopt(tSock, SOL_SOCKET, SO_REUSEADDR, &tEnable, sizeof (tEnable));
+  server_addr->ai_addr->sa_family = server_addr->ai_family; // ensure that server_addr has same famliy than the socket
   if (bind(tSock, server_addr->ai_addr, server_addr->ai_addrlen) < 0)
   {
     close(tSock);
