summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2015-04-08 11:54:09 +0000
committerMatthew Jordan <mjordan@digium.com>2015-04-08 11:54:09 +0000
commit477536ef25bf8a95ea4a43800ee14f15e0b67dcc (patch)
tree10d702e928d2e95b6655f3ea9eda02ce49b44c93 /channels/chan_sip.c
parentb8fa8aa77534fae8cea46d67c15b49f9677879bb (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@434290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index d9ed538cb..b64ca0816 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -3777,7 +3777,7 @@ static void ast_sip_ouraddrfor(const struct ast_sockaddr *them, struct ast_socka
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 "