--- Makefile +++ Makefile 2013-12-03 08:14:47.362446079 +0000 @@ -46,7 +67,7 @@ SHELL = /bin/sh # If you know that the IPv6 functions work on your machine, you can enable # them here. -##IPv6 = -DHAVE_IPv6_FUNCS +IPv6 = -DHAVE_IPv6_FUNCS # # Binaries are stripped with this command after installation. --- fio.c +++ fio.c 2013-12-04 07:46:41.302735482 +0000 @@ -1023,7 +1023,17 @@ sopen(const char *xserver, struct sock * char *cp; char *server = (char *)xserver; - if ((cp = strchr(server, ':')) != NULL) { + if (*server == '[' && (cp = strchr(server, ']')) != NULL) { + if (cp[1] == ':') { + portstr = &cp[2]; +#ifndef HAVE_IPv6_FUNCS + port = strtol(portstr, NULL, 10); +#endif /* HAVE_IPv6_FUNCS */ + } + server = salloc(cp - xserver); + memcpy(server, xserver+1, cp - xserver - 1); + server[cp - xserver - 1] = '\0'; + } else if ((cp = strchr(server, ':')) != NULL) { portstr = &cp[1]; #ifndef HAVE_IPv6_FUNCS port = strtol(portstr, NULL, 10);