Author: mjordan
Date: Wed Apr  8 06:54:09 2015
New Revision: 434290

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=434290
Log:
chan_sip: Handle IPv4 mapped IPv6 clients when NAT is enabled

When udpbindaddr is set to the IPv6 bind all address of '::', Asterisk will
attempt to handle both IPv4 and IPv6 addresses, although the information will
be stored in a struct with an AF_INET6 address type. However, the current
NAT handling code won't handle the IPv4 mapped IPv6 addresses correctly.
This patch adds an additional check for the mapped address case, allowing
the NAT code to handle clients even when the address is IPv6.

Review: https://reviewboard.asterisk.org/r/4563/

ASTERISK-18032 #close
Reported by: Christoph Timm
patches:
  nat_with_ipv6.diff submitted by Valentin Vidić (License 6697)
........

Merged revisions 434288 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 434289 from http://svn.asterisk.org/svn/asterisk/branches/13

Modified:
    trunk/   (props changed)
    trunk/channels/chan_sip.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-13-merged' - no diff available.

Modified: trunk/channels/chan_sip.c
URL: 
http://svnview.digium.com/svn/asterisk/trunk/channels/chan_sip.c?view=diff&rev=434290&r1=434289&r2=434290
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Apr  8 06:54:09 2015
@@ -3777,7 +3777,7 @@
        ast_ouraddrfor(them, us);
        ast_sockaddr_copy(&theirs, them);
 
-       if (ast_sockaddr_is_ipv6(&theirs)) {
+       if (ast_sockaddr_is_ipv6(&theirs) && 
!ast_sockaddr_is_ipv4_mapped(&theirs)) {
                if (localaddr && !ast_sockaddr_isnull(&externaddr) && 
!ast_sockaddr_is_any(&bindaddr)) {
                        ast_log(LOG_WARNING, "Address remapping activated in 
sip.conf "
                                "but we're using IPv6, which doesn't need it. 
Please "


-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

svn-commits mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/svn-commits

Reply via email to