Index: src/common/net/sock.c
--- src/common/net/sock.c.orig	2012-02-01 21:59:25.000000000 +0100
+++ src/common/net/sock.c	2012-05-16 22:33:42.000000000 +0200
@@ -732,7 +732,7 @@
 
         setsockopt (sock, SOL_SOCKET, SO_REUSEADDR, (const void *)&on, sizeof(on));
         on = 0;
-#ifdef IPV6_V6ONLY
+#if defined(IPV6_V6ONLY) && defined(IPPROTO_IPV6)
         setsockopt (sock, IPPROTO_IPV6, IPV6_V6ONLY, &on, sizeof on);
 #endif
 
