Should fix rjlan's Windows Vista IPV6 problems.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@2335 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2006-06-27 16:00:41 +00:00
parent 2fabcc0904
commit 725912224d

View file

@ -1729,6 +1729,7 @@ int maxport = port + 100;
#ifdef IPPROTO_IPV6 #ifdef IPPROTO_IPV6
int UDP6_OpenSocket (int port, qboolean bcast) int UDP6_OpenSocket (int port, qboolean bcast)
{ {
int err;
int newsocket; int newsocket;
struct sockaddr_in6 address; struct sockaddr_in6 address;
unsigned long _true = true; unsigned long _true = true;
@ -1775,10 +1776,20 @@ int maxport = port + 100;
if( bind (newsocket, (void *)&address, sizeof(address)) == -1) if( bind (newsocket, (void *)&address, sizeof(address)) == -1)
{ {
if (!port) if (!port)
Sys_Error ("UDP6_OpenSocket: bind: %s", strerror(qerrno)); {
err = qerrno;
Con_Printf ("UDP6_OpenSocket: bind: (%i) %s", err, strerror(err));
closesocket(newsocket);
return INVALID_SOCKET;
}
port++; port++;
if (port > maxport) if (port > maxport)
Sys_Error ("UDP6_OpenSocket: bind: %s", strerror(qerrno)); {
err = qerrno;
Con_Printf ("UDP6_OpenSocket: bind: (%i) %s", err, strerror(err));
closesocket(newsocket);
return INVALID_SOCKET;
}
} }
else else
break; break;