[asterisk-dev] NAT mapping while binding to IPv6

Kevin P. Fleming kpfleming at digium.com
Tue Sep 6 10:22:14 CDT 2011


On 09/06/2011 10:18 AM, Simon Perreault wrote:
> Jeremy Visser wrote, on 09/04/2011 11:07 AM:
>> In ast_sip_ouraddrfor() in chan_sip.c, there is some "if
>> (ast_sockaddr_is_ipv6(&theirs))" logic which seems to divert along a separate
>> code path for when binding to an IPv6 socket that doesn't support NAT
>> mapping.
>>
>> I'm not a qualified C coder so please forgive me if I am completely wrong
>> here, but am I right in guessing that the NAT handling code is hardcoded to
>> expect AF_INET structures, whereas the code path taken if
>> ast_sockaddr_is_ipv6() is true uses AF_INET6, leading to the fact that the
>> nat= option is being ignored?
>
> Right. The STUN subsystem and other NAT handling code has not been ported to
> IPv6 yet. As IPv6 currently has no NAT, doing that was deemed low priority. IMHO
> it is a missing feature, not a bug per se.

Except in this case, the endpoint that Asterisk was communicating with 
was using IPv4, and Asterisk was using a dual-stack socket. This 
resulted in Asterisk not performing its normal NAT traversal mechanics, 
even though they should have been done for this endpoint. That's the bug.

-- 
Kevin P. Fleming
Digium, Inc. | Director of Software Technologies
Jabber: kfleming at digium.com | SIP: kpfleming at digium.com | Skype: kpfleming
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list