[asterisk-dev] IPv4 and IPv6 preference

Mark Michelson mmichelson at digium.com
Fri Jul 16 09:51:26 CDT 2010


On 07/16/2010 08:45 AM, Olle E. Johansson wrote:
> 16 jul 2010 kl. 15.33 skrev Simon Perreault:
>
>    
>> On 2010-07-16 09:23, Olle E. Johansson wrote:
>>      
>>> I've been trying to understand some of the DNS support for IPv6 and can't find traces here. It seems a bit random.
>>>        
>> By default, on most OSes, getaddrinfo() will return IPv6 results first.
>>
>> We make no attempt to change the default order. However, we don't want
>> to connect to IPv6 addresses if we are bound only to IPv4, and
>> vice-versa. So we implemented the following heuristic:
>>
>> - If bindaddr is the IPv6 wildcard address (i.e. ::), we do not filter
>> results.
>> - If bindaddr is an IPv4 address, we only use IPv4 results.
>> - Otherwise, we only use IPv6 results.
>>      
> Hmm. I need to revisit the code, because I saw nothing doing this in dnsmgr or acl.c. Must have put my brain in weekend-mode early...
>    
While the mention of dnsmgr.c has merit, acl.c doesn't need such a 
distinction because users are required to use IP addresses. Host names 
are not allowed in ACLs so DNS will not come into the picture.

Mark Michelson





More information about the asterisk-dev mailing list