[asterisk-dev] IPv4 and IPv6 preference

Olle E. Johansson oej at edvina.net
Fri Jul 16 11:26:48 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().
Ouch. Ok.

> 
>> Yes. At least the first ipv4 and the first IPv6 is needed now, if we can't get it right. Otherwise it will fail miserably in dual stack environments.
> 
> What do you mean by "fail miserably"? If a host has both AAAA and A
> records, and we try just one of them, how are we worse off than we were
> before?
Before we only supported one address family. Now we have many more scenarios to support - both for IPv4 only, dual stack and IPv6 only environments. Previously we only had to worry about IPv4. Having said that, there is stuff we have to add to 1.4 since it doesn't respond properly to IPv6 addresses or SDPs today, which it should do.

I hate the fact that my web browsing experience doesn't work when I enable IPv6 and run dual stacks on my laptop, because the browser doesn't handle it very well. Let's fix that so that calls do not fail.

> 
>> Considering me configuring my SRV set with the first record ONLY resolving to IPv6 and the second one ONLY resolving to IPv4 - with a lower priority. Will an IPv4 only asterisk find the IPv4 SRV record or fail since the first one with highest priority was only IPv6?
> 
> This is SRV-specific. The discussion above was only related to a single
> host name that has multiple AAAA and A records.
I was discussing SRV all the time.
> 
> In your example, if you replace the IPv6 address with an IPv4 address
> that is unreachable, will Asterisk try the second one? If so, then it
> will fall back on the IPv4 address in your example after being unable to
> reach the IPv6 address.
I don't think either case works. That's what worries me.

> 
>> Btw, this is the recommendation we came up with at SIPit to control IPv6/ipv4 services and show my preference for RECEIVING calls to my domain. Even if it's the same host, add two host names with different resolution on different priorities.
> 
> Yes, this is indeed *the* way to do it.
So let's make sure Asterisk supports this properly.

/O
> 
> Simon
> -- 
> NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca
> STUN/TURN server        --> http://numb.viagenie.ca
> vCard 4.0               --> http://www.vcarddav.org
> 
> -- 
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> 
> asterisk-dev mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-dev

---
* Olle E Johansson - oej at edvina.net
* Cell phone +46 70 593 68 51, Office +46 8 96 40 20, Sweden






More information about the asterisk-dev mailing list