mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 01:41:10 +00:00
Use the last used interface address for the socket address.
This allows the correct address to be put in the server info packet allowing nq to work on multi-homed hosts. More testing needs to be done to ensure nothing is broken, or better yet, a rewrite of the networking code to properly associate the information with the packets.
This commit is contained in:
parent
ae9404cc27
commit
805256ff65
1 changed files with 5 additions and 2 deletions
|
@ -514,8 +514,11 @@ UDP_GetSocketAddr (int socket, struct qsockaddr *addr)
|
|||
|
||||
getsockname (socket, (struct sockaddr *) addr, &addrlen);
|
||||
a = ((struct sockaddr_in *) addr)->sin_addr.s_addr;
|
||||
if (a == 0 || a == inet_addr ("127.0.0.1"))
|
||||
((struct sockaddr_in *) addr)->sin_addr.s_addr = myAddr;
|
||||
if (a == 0 || a == inet_addr ("127.0.0.1")) {
|
||||
((struct sockaddr_in *) addr)->sin_addr.s_addr = *default_iface;
|
||||
if (last_iface)
|
||||
((struct sockaddr_in *) addr)->sin_addr.s_addr = *last_iface;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue