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:
Bill Currie 2011-08-22 10:30:35 +09:00
parent 70d42cc838
commit ce07000054
3 changed files with 6 additions and 2 deletions

View file

@ -170,7 +170,9 @@ int UDP_GetAddrFromName (const char *name, struct qsockaddr *addr);
\param addr1 The first 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
is different.
\return 0 if everything is the same.

View file

@ -1273,6 +1273,8 @@ _Datagram_Connect (const char *host)
if (ret > 0) {
// is it from the right place?
if (sfunc.AddrCompare (&readaddr, &sendaddr) != 0) {
Sys_MaskPrintf (SYS_NET, "%2d ",
sfunc.AddrCompare (&readaddr, &sendaddr));
Sys_MaskPrintf (SYS_NET, "%s ",
sfunc.AddrToString (&readaddr));
Sys_MaskPrintf (SYS_NET, "%s\n",

View file

@ -573,7 +573,7 @@ int
UDP_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2)
{
if (addr1->qsa_family != addr2->qsa_family)
return -1;
return -2;
if (((struct sockaddr_in *) addr1)->sin_addr.s_addr !=
((struct sockaddr_in *) addr2)->sin_addr.s_addr)