[MPlayer-dev-eng] gethostbyname2 vs. getaddrinfo

Raimund Steger rs at mytum.de
Sat Feb 25 16:45:26 CET 2012


Dear list,

I've been using a very minor adjustment to stream/tcp.c for a while (as 
attached) to enable AF_INET6 name lookup on Solaris, which does not have 
gethostbyname2.

It replaces gethostbyname2 with a simple getaddrinfo call and uses the 
first returned address. ./configure already checks for that function, so 
no change there (apart from maybe removing the gethostbyname2 check).

On all the systems I've been able to test (Solaris 10 x86, Solaris 11 
Express SPARC, Linux x86, FreeBSD x86) this seems to work for me, and at 
least doesn't seem to introduce additional problems on Windows. Other 
systems I haven't tested.

Now whether this is ready for prime time or not, by chance I've 
encountered a more complex/sophisticated patch lurking around at 
http://bugzilla.mplayerhq.hu/show_bug.cgi?id=1930 which is probably more 
by-the-book in that it tries all addresses returned, and which I've 
found to also work on Solaris 10 if I add an additional 
'hints.ai_socktype = SOCK_STREAM;' after line 106.

So maybe something along those lines could eventually make it into the 
mplayer trunk?

Regards
Raimund


-- 
Worringer Str 31 Duesseldorf 40211 Germany +49-179-2981632 icq 16845346


-------------- next part --------------
A non-text attachment was scrubbed...
Name: getaddrinfo-stream.c.patch
Type: text/x-patch
Size: 1215 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/mplayer-dev-eng/attachments/20120225/35cd0652/attachment.bin>


More information about the MPlayer-dev-eng mailing list