[asterisk-dev] IPv4 and IPv6 preference

Simon Perreault simon.perreault at viagenie.ca
Wed Jul 28 09:14:38 CDT 2010


Olle E. Johansson wrote, on 07/28/2010 03:38 PM:
> 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 agree it is a bug, but it's the best situation we could reach without
completely rearchitecturing chan_sip. In my opinion, I estimate that the effort
required to do this would exceed the total effort we spent doing the IPv6
conversion in the first place. And we spent *a lot* of effort.

> 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.

No. Two would not be much better. We need N.

With the current situation, you can do one of four things:
a) Listen on a specific IPv4 address.
b) Listen on a specific IPv6 address.
c) Listen on the IPv4 wildcard.
d) Listen on the IPv4 and IPv6 wildcards.
(You can choose independently for UDP, TCP, and TLS.)

With two sockets for each transport protocol, you could pick two out of the four
above for each transport protocol. But you could still be limited. Suppose for
example that you want to listen on one specific IPv4 address and two specific
IPv6 addresses.

We need N sockets of any address family and transport protocol.

And that's a big change, but is completely unrelated to IPv6. With the IPv6
conversion we added cases b) and d) above. Before, only a) and c) were possible.
So I certainly don't see this as a step back.

What's stopping anyone from putting the diff on the review board?

Simon
-- 
NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca
STUN/TURN server        --> http://numb.viagenie.ca
vCard 4.0               --> http://www.vcarddav.org



More information about the asterisk-dev mailing list