$OpenBSD: patch-deps_uv_src_unix_tcp_c,v 1.1 2018/09/19 19:10:27 abieber Exp $

Index: deps/uv/src/unix/tcp.c
--- deps/uv/src/unix/tcp.c.orig
+++ deps/uv/src/unix/tcp.c
@@ -183,6 +183,23 @@ int uv__tcp_bind(uv_tcp_t* tcp,
 #endif
 #endif
 
+#ifdef IPV6_V6ONLY
+  if (addr->sa_family == AF_INET6) {
+    on = (flags & UV_TCP_IPV6ONLY) != 0;
+    if (setsockopt(tcp->io_watcher.fd,
+                   IPPROTO_IPV6,
+                   IPV6_V6ONLY,
+                   &on,
+                   sizeof on) == -1) {
+#if defined(__MVS__)
+      if (errno == EOPNOTSUPP)
+        return -EINVAL;
+#endif
+      return -errno;
+    }
+  }
+#endif
+
   errno = 0;
   if (bind(tcp->io_watcher.fd, addr, addrlen) && errno != EADDRINUSE) {
     if (errno == EAFNOSUPPORT)
