aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-12 18:32:33 +0000
committerludwig <ludwig@edf5b092-35ff-0310-97b2-ce42778d08ea>2008-06-12 18:32:33 +0000
commita4d1572fe38e3f4dfbdc1f0ee0b203da099a4717 (patch)
treec53c6ae38062145d1861a57d26aedd2dc371bbe4 /code
parent6061fb0c3d5fb4f409782e411cfdaf0510243eb1 (diff)
downloadioquake3-aero-a4d1572fe38e3f4dfbdc1f0ee0b203da099a4717.tar.gz
ioquake3-aero-a4d1572fe38e3f4dfbdc1f0ee0b203da099a4717.zip
bind ipv6 sockets first
by binding the ipv6 sockets first it's possible to bind 0.0.0.0 and :: to the same port. git-svn-id: svn://svn.icculus.org/quake3/trunk@1386 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code')
-rw-r--r--code/qcommon/net_ip.c41
1 files changed, 21 insertions, 20 deletions
diff --git a/code/qcommon/net_ip.c b/code/qcommon/net_ip.c
index 50eddf8..dd59320 100644
--- a/code/qcommon/net_ip.c
+++ b/code/qcommon/net_ip.c
@@ -1329,6 +1329,27 @@ void NET_OpenIP( void ) {
// 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 @@ void NET_OpenIP( void ) {
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");
- }
}