[asterisk-dev] IPv4 and IPv6 preference

Olle E. Johansson oej at edvina.net
Wed Jul 28 08:38:11 CDT 2010


16 jul 2010 kl. 15.59 skrev Simon Perreault:

> On 2010-07-16 09:45, Olle E. Johansson wrote:
>>> - 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...
> 
> It's SIP-specific. It's a big ugly hack and nobody else should use it.
> Since we don't want to facilitate hack propagation, it's restricted to
> chan_sip. See ast_sockaddr_resolve_first().

This is really ugly, since it is based on the family of bindaddr, which is for UDP only. I see a lot of code using this as a preference, which is propably a poor solution. This limits the use and doesn't really follow the architecture we're trying to complete in asterisk with udp, tcp, tls and udptl support.

At least, we need some documentation on this. sip.conf.sample only has IPv6 in the ACL part. That's a BUG.

I do want people to use IPv6, and to get there we need a working implementation and not just something that fits the "ipv6 required" checkbox... We can do better in the Asterisk community.

Now the question is why we only have ONE bindaddr structure. We should have at least one per family if we assume that the default setup is dual stack. Otherwise, I will have to run TWO asterisk servers - one for IPv4 and one for IPv6, which doesn't seem to be a solution.

How did you think here?


/O


More information about the asterisk-dev mailing list