Bug 3649 - PowerPC Mac OS X server browser failing...
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: GIT MASTER
Hardware: Macintosh MacOS X
: P3 major
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2008-05-17 04:01 EDT by Ryan C. Gordon
Modified: 2008-05-17 06:47:27 EDT
0 users

See Also:


Attachments
Patch to fix network browser on PPC Macs. (681 bytes, patch)
2008-05-17 04:03 EDT, Ryan C. Gordon

Description Ryan C. Gordon 2008-05-17 04:01:59 EDT
I assume this is either a bug in PowerPC OS X, or a bug in Intel OS X, but the behaviour is different between the two.

Basically: the server browser is hosed. It gives this error as it queries each server in the list:

   Sys_StringToSockaddr: Error resolving 209.51.138.221: Bad hints

LAN browsing worked, because Sys_StringToSockaddr() specified a real value for (family), whereas Internet browsing appears to leave this as AF_UNSPEC.

Passing a NULL hint structure instead of a pointer to a zero'd out one fixes the issue on PowerPC OS X, so I'm attaching a patch that does so if the family is unspecified.

This patch should be harmless on Intel Mac OS X, but appears to work without it, so it might be that our code is fine, and this is a workaround for an OS bug.

Haven't tested this recently on 10.4, but it looks like this net code is new since the last time I tried, so it may not be a 10.5-specific thing.

--ryan.
Comment 1 Ryan C. Gordon 2008-05-17 04:03:33 EDT
Created attachment 1760 [details]
Patch to fix network browser on PPC Macs.


Attached patch against svn revision #1343.

--ryan.
Comment 2 Thilo Schulz 2008-05-17 06:47:27 EDT
Yes, the code changed when I added ipv6 support. MacOSX seems to have an incorrectly implemented getaddrinfo(). Here is the relevant section from the man page:

AF_UNSPEC in ai_family specifies any protocol family (either IPv4 or IPv6, for  example).

On the other hand, this is what it says too:

A NULL hints specifies that any network address or protocol is acceptable.

So since I only set ai_family in that structure anyways, the workaround will result in identical behaviour on any platform. Thanks for reporting, fixed in SVN rev 1044.