r1386 - trunk/code/qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Thu Jun 12 14:32:33 EDT 2008


Author: ludwig
Date: 2008-06-12 14:32:33 -0400 (Thu, 12 Jun 2008)
New Revision: 1386

Modified:
   trunk/code/qcommon/net_ip.c
Log:
bind ipv6 sockets first

by binding the ipv6 sockets first it's possible to bind 0.0.0.0 and
:: to the same port.


Modified: trunk/code/qcommon/net_ip.c
===================================================================
--- trunk/code/qcommon/net_ip.c	2008-06-12 18:32:29 UTC (rev 1385)
+++ trunk/code/qcommon/net_ip.c	2008-06-12 18:32:33 UTC (rev 1386)
@@ -1329,6 +1329,27 @@
 	// automatically scan for a valid port, so multiple
 	// dedicated servers can be started without requiring
 	// a different net_port for each one
+
+	if(net_enabled->integer & NET_ENABLEV6)
+	{
+		for( i = 0 ; i < 10 ; i++ )
+		{
+			ip6_socket = NET_IP6Socket(net_ip6->string, port6 + i, &boundto, &err);
+			if (ip6_socket != INVALID_SOCKET)
+			{
+				Cvar_SetValue( "net_port6", port6 + i );
+				break;
+			}
+			else
+			{
+				if(err == EAFNOSUPPORT)
+					break;
+			}
+		}
+		if(ip6_socket == INVALID_SOCKET)
+			Com_Printf( "WARNING: Couldn't bind to a v6 ip address.\n");
+	}
+
 	if(net_enabled->integer & NET_ENABLEV4)
 	{
 		for( i = 0 ; i < 10 ; i++ ) {
@@ -1351,26 +1372,6 @@
 		if(ip_socket == INVALID_SOCKET)
 			Com_Printf( "WARNING: Couldn't bind to a v4 ip address.\n");
 	}
-	
-	if(net_enabled->integer & NET_ENABLEV6)
-	{
-		for( i = 0 ; i < 10 ; i++ )
-		{
-			ip6_socket = NET_IP6Socket(net_ip6->string, port6 + i, &boundto, &err);
-			if (ip6_socket != INVALID_SOCKET)
-			{
-				Cvar_SetValue( "net_port6", port6 + i );
-				break;
-			}
-			else
-			{
-				if(err == EAFNOSUPPORT)
-					break;
-			}
-		}
-		if(ip6_socket == INVALID_SOCKET)
-			Com_Printf( "WARNING: Couldn't bind to a v6 ip address.\n");
-	}
 }
 
 




More information about the quake3-commits mailing list