mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 04:42:32 +00:00
Make the address comparison a little more informative.
Still hunting the openbsd connection issues. It seems the address comparision isn't working.
This commit is contained in:
parent
70d42cc838
commit
ce07000054
3 changed files with 6 additions and 2 deletions
|
@ -170,7 +170,9 @@ int UDP_GetAddrFromName (const char *name, struct qsockaddr *addr);
|
||||||
|
|
||||||
\param addr1 The first address to compare.
|
\param addr1 The first address to compare.
|
||||||
\param addr2 The second address to compare.
|
\param addr2 The second address to compare.
|
||||||
\return -1 if the family or address are different.
|
\return -2 if the family is different.
|
||||||
|
\return -1 if the family is the same, but the address is
|
||||||
|
different.
|
||||||
\return 1 if the family and address are the same, but the port
|
\return 1 if the family and address are the same, but the port
|
||||||
is different.
|
is different.
|
||||||
\return 0 if everything is the same.
|
\return 0 if everything is the same.
|
||||||
|
|
|
@ -1273,6 +1273,8 @@ _Datagram_Connect (const char *host)
|
||||||
if (ret > 0) {
|
if (ret > 0) {
|
||||||
// is it from the right place?
|
// is it from the right place?
|
||||||
if (sfunc.AddrCompare (&readaddr, &sendaddr) != 0) {
|
if (sfunc.AddrCompare (&readaddr, &sendaddr) != 0) {
|
||||||
|
Sys_MaskPrintf (SYS_NET, "%2d ",
|
||||||
|
sfunc.AddrCompare (&readaddr, &sendaddr));
|
||||||
Sys_MaskPrintf (SYS_NET, "%s ",
|
Sys_MaskPrintf (SYS_NET, "%s ",
|
||||||
sfunc.AddrToString (&readaddr));
|
sfunc.AddrToString (&readaddr));
|
||||||
Sys_MaskPrintf (SYS_NET, "%s\n",
|
Sys_MaskPrintf (SYS_NET, "%s\n",
|
||||||
|
|
|
@ -573,7 +573,7 @@ int
|
||||||
UDP_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2)
|
UDP_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2)
|
||||||
{
|
{
|
||||||
if (addr1->qsa_family != addr2->qsa_family)
|
if (addr1->qsa_family != addr2->qsa_family)
|
||||||
return -1;
|
return -2;
|
||||||
|
|
||||||
if (((struct sockaddr_in *) addr1)->sin_addr.s_addr !=
|
if (((struct sockaddr_in *) addr1)->sin_addr.s_addr !=
|
||||||
((struct sockaddr_in *) addr2)->sin_addr.s_addr)
|
((struct sockaddr_in *) addr2)->sin_addr.s_addr)
|
||||||
|
|
Loading…
Reference in a new issue