Force (WS_)SO_REUSEADDR before binding to a socket; ignore

(WS_)SO_DONTROUTE; Network games in Grand Prix Legends and Nascar 2002
are possible now.
This commit is contained in:
Christoph Frick 2002-12-06 23:19:21 +00:00 committed by Alexandre Julliard
parent bcf2a78268
commit 983088a03b

View file

@ -1479,6 +1479,12 @@ int WINAPI WS_bind(SOCKET s, const struct WS_sockaddr* name, int namelen)
}
else
{
int on = 1;
/* The game GrandPrixLegends binds more than one time, but does
* not do a SO_REUSEADDR - Stevens says this is ok */
FIXME( "Setting WS_SO_REUSEADDR on socket before we binding it\n");
WS_setsockopt( s, WS_SOL_SOCKET, WS_SO_REUSEADDR, (char*)&on, sizeof(on) );
if (bind(fd, uaddr, uaddrlen) < 0)
{
int loc_errno = errno;
@ -2678,6 +2684,17 @@ int WINAPI WS_setsockopt(SOCKET s, int level, int optname,
return 0;
}
/* For some reason the game GrandPrixLegends does set SO_DONTROUTE on its
* socket. This will either not happen under windows or it is ignored in
* windows (but it works in linux and therefor prevents the game to find
* games outsite the current network) */
if ( level==WS_SOL_SOCKET && optname==WS_SO_DONTROUTE )
{
FIXME("Does windows ignore SO_DONTROUTE?\n");
return 0;
}
fd = _get_sock_fd(s);
if (fd != -1)
{