[asterisk-dev] NAT mapping while binding to IPv6

Kevin P. Fleming kpfleming at digium.com
Wed Sep 7 07:18:58 CDT 2011


On 09/06/2011 06:05 PM, Ryan Wagoner wrote:
> On Tue, Sep 6, 2011 at 8:03 AM, Kevin P. Fleming<kpfleming at digium.com>  wrote:
>> On 09/05/2011 03:41 PM, Klaus Darilion wrote:
>>>
>>> On 04.09.2011 17:07, Jeremy Visser wrote:
>>>>
>>>> Hi folks,
>>>>
>>>> I'm having an issue with NAT mapping and IPv6. Basically the scenario
>>>> is that if tcp/udpbindaddr=[::], then the nat=yes option I specified
>>>> in sip.conf is ignored. This is a problem because the fact that some
>>>> of my SIP clients supporting IPv6 doesn't magically mean the IPv4-only
>>>> ones aren't behind NATs any more.
>>>>
>>>> So I'm forced to support v4-only in order to not break NAT'ed clients.
>>>>
>>>> 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?
>>>>
>>>> I'm not cluey enough to know how this works, but what would it take to
>>>> get nat=yes support while binding to an IPv6 address?
>>>
>>> If v4 and v6 are really handled different, then it should be fixed. IMO
>>> nat=yes means nat=yes, regardless if transport is v4 or v6.
>>
>> Agreed; this is a serious bug and needs to be addressed ASAP.
>>
>> --
>> 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
>
> Glad to hear this is going to be addressed now. I had mentioned it
> back in Dec 2010 and there didn't seem to be any interest.
>
> http://lists.digium.com/pipermail/asterisk-users/2010-December/256975.html

If there's an issue open for this in JIRA already, we need to get one in 
there so we can get this fixed up. While I agree with Simon that it's 
not a regression (using the identical configuration as with an older 
version of Asterisk won't have the problem), it's still not a good 
situation.

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