[vlc-devel] getaddrinfo stuck when using nonexistent domain suffix

Falck Kenneth kennu at swelcom.fi
Wed Nov 1 04:53:39 CET 2006


Hi,

We're using VLC on WinXP for multicast playback of 239.42.1.1 style IPv4
addresses, and it sometimes gets stuck for ~15 sec when opening a
stream.

Apparently this is caused by getaddrinfo(), which tries to resolve
addresses like 239.42.1.1.our.internal.domain.com for AAAA records. (The
internal domain suffix comes from our Windows domain setup. The delay
only happens when the internal DNS server is unavailable, i.e. when an
office laptop is connected directly to the Internet.)

A possible fix would be to call getaddrinfo() first with AI_NUMERICHOST
to check if the playback address is numeric, and use the returned
address if it is. If not, it would be called again with default options
to resolve any DNS names.

After reading the getaddrinfo() docs and RFCs it seems that they make no
guarantee of NOT trying to resolve n.n.n.n addresses from DNS in the
IPv6 family context. So the only reliable solution is either to limit
queries to IPv4 or use AI_NUMERICHOST first.

Do you have any comments? This would seem to be potential problem for
any Windows users that are using domains with internal DNS.

PS. Things work fine when using --ipv4, which forces the AF_INET hint
for getaddrinfo(). But it seems like a workaround to do it manually.

-- 
Kenneth Falck, SWelcom Oy, Ludviginkatu 6-8, 00130 Helsinki, Finland
Private: kennu at iki.fi  Business: kennu at swelcom.fi  GSM: +358405103121
                 Balance is the essential component.

-- 
This is the vlc-devel mailing-list, see http://www.videolan.org/vlc/
To unsubscribe, please read http://developers.videolan.org/lists.html



More information about the vlc-devel mailing list