summaryrefslogtreecommitdiff
path: root/res/res_rtp_asterisk.c
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-10-08 15:46:16 +0000
committerKinsey Moore <kmoore@digium.com>2013-10-08 15:46:16 +0000
commit4873c11f64e80d2c31676db899cff0abd4b8c145 (patch)
tree7251a084569b7d5fd0714e823f97b42e470bbf4a /res/res_rtp_asterisk.c
parenta4d6f439625fb4fb1546c578d5809a1ebb45f1e0 (diff)
Fix STUN crash when using IPv6 any address
Ensure that when chan_sip binds to the IPv6 any address ([::]), IPv4 candidates are also added. (closes issue ASTERISK-21917) Reported by: Torrey Searle Patches: 0023_ipv6_stun_crash.patch uploaded by Torrey Searle (License 5334) ........ Merged revisions 400681 from http://svn.asterisk.org/svn/asterisk/branches/11 ........ Merged revisions 400682 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@400684 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_rtp_asterisk.c')
-rw-r--r--res/res_rtp_asterisk.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index c2b8453c4..e2a105662 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1661,7 +1661,13 @@ static void rtp_add_candidates_to_ice(struct ast_rtp_instance *instance, struct
unsigned int count = PJ_ARRAY_SIZE(address), pos = 0;
/* Add all the local interface IP addresses */
- pj_enum_ip_interface(ast_sockaddr_is_ipv4(addr) ? pj_AF_INET() : pj_AF_INET6(), &count, address);
+ if (ast_sockaddr_is_ipv4(addr)) {
+ pj_enum_ip_interface(pj_AF_INET(), &count, address);
+ } else if (ast_sockaddr_is_any(addr)) {
+ pj_enum_ip_interface(pj_AF_UNSPEC(), &count, address);
+ } else {
+ pj_enum_ip_interface(pj_AF_INET6(), &count, address);
+ }
for (pos = 0; pos < count; pos++) {
pj_sockaddr_set_port(&address[pos], port);