--- Unreal3.2.7.orig/src/s_conf.c	2007-07-22 10:58:22.539110247 -0700
+++ Unreal3.2.7/src/s_conf.c	2007-07-22 16:30:49.142060554 -0700
@@ -4198,10 +4198,24 @@ int	_test_listen(ConfigFile *conf, Confi
 #ifdef INET6
 	if ((strlen(ip) > 6) && !strchr(ip, ':') && isdigit(ip[strlen(ip)-1]))
 	{
-		config_error("%s:%i: listen: ip set to '%s' (ipv4) on an IPv6 compile, "
-		              "use the ::ffff:1.2.3.4 form instead",
+		if(inet_aton(ip, NULL) != 0) {
+			char *ipv6 = MyMalloc(48);
+			snprintf(ipv6, 47, "::ffff:%s", ip);
+			char *ipv6Port = MyMalloc(64);
+			snprintf(ipv6Port, 63, "[%s]:%s", ipv6, port);
+			ip = strdup(ipv6);
+			MyFree(ipv6);
+
+			MyFree(ce->ce_vardata);
+			ce->ce_vardata = strdup(ipv6Port);
+
+			MyFree(ipv6Port);
+		} else {
+		/* Insert IPv6 validation here */
+			config_error("%s:%i: listen: '%s' looks like it might be IPv4, but is not a valid address.",
 					ce->ce_fileptr->cf_filename, ce->ce_varlinenum, ip);
-		return 1;
+			return 1;
+		}
 	}
 #endif
 	port_range(port, &start, &end);
@@ -6081,11 +6095,20 @@ int	_test_link(ConfigFile *conf, ConfigE
 			if (cep->ce_vardata && (strlen(cep->ce_vardata) > 6) && !strchr(cep->ce_vardata, ':') &&
 			    isdigit(cep->ce_vardata[strlen(cep->ce_vardata)-1]))
 			{
-				config_error("%s:%i: link %s has link::hostname set to '%s' (IPv4) on a IPv6 compile, "
-				              "use the ::ffff:1.2.3.4 form instead",
-							cep->ce_fileptr->cf_filename, cep->ce_varlinenum, ce->ce_vardata,
-							cep->ce_vardata);
-				errors++;
+				if(inet_aton(cep->ce_vardata, NULL) != 0) {
+					char *ipv6 = MyMalloc(48);
+					snprintf(ipv6, 47, "::ffff:%s", cep->ce_vardata);
+					MyFree(cep->ce_vardata);
+					cep->ce_vardata = strdup(ipv6);
+					MyFree(ipv6);
+				} else {
+				/* Insert IPv6 validation here */
+					config_error( "%s:%i: listen: '%s' looks like "
+						"it might be IPv4, but is not a valid address.",
+						ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
+						cep->ce_vardata);
+					errors++;
+				}
 			}
 #endif
 			if (strchr(cep->ce_vardata, '*') != NULL || strchr(cep->ce_vardata, '?'))
@@ -6352,10 +6375,20 @@ int	_test_cgiirc(ConfigFile *conf, Confi
 			if (cep->ce_vardata && (strlen(cep->ce_vardata) > 6) && !strchr(cep->ce_vardata, ':') &&
 			    isdigit(cep->ce_vardata[strlen(cep->ce_vardata)-1]))
 			{
-				config_error("%s:%i: cgiirc block has cgiirc::hostname set to '%s' (IPv4) on a IPv6 compile, "
-				              "use the ::ffff:1.2.3.4 form instead",
-							cep->ce_fileptr->cf_filename, cep->ce_varlinenum, cep->ce_vardata);
-				errors++;
+				if(inet_aton(cep->ce_vardata, NULL) != 0) {
+					char *ipv6 = MyMalloc(48);
+					snprintf(ipv6, 47, "::ffff:%s", cep->ce_vardata);
+					MyFree(cep->ce_vardata);
+					cep->ce_vardata = strdup(ipv6);
+					MyFree(ipv6);
+				} else {
+				/* Insert IPv6 validation here */
+					config_error( "%s:%i: cgiirc: '%s' looks like "
+						"it might be IPv4, but is not a valid address.",
+						ce->ce_fileptr->cf_filename, ce->ce_varlinenum,
+						cep->ce_vardata);
+					errors++;
+				}
 			}
 #endif
 		}
