Merged revisions 335321 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/10

................
  r335321 | kmoore | 2011-09-12 08:27:04 -0500 (Mon, 12 Sep 2011) | 16 lines
  
  Merged revisions 335320 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r335320 | kmoore | 2011-09-12 08:25:42 -0500 (Mon, 12 Sep 2011) | 9 lines
    
    Prevent IAX2 from getting IPv6 addresses via DNS
    
    IAX2 does not support IPv6 and getting such addresses from DNS can cause error
    messages on the remote end involving bad IPv4 address casts in the presence of
    IPv6/IPv4 tunnels.  This patch ensures that IAX2 will not encounter IPv6
    addresses via DNS queries.
    
    (closes issue ASTERISK-18090)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335322 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Kinsey Moore
2011-09-12 13:27:45 +00:00
parent 986f2d8836
commit c5c1fed9b6

View File

@@ -8573,6 +8573,7 @@ static int iax2_append_register(const char *hostname, const char *username,
if (!(reg = ast_calloc(1, sizeof(*reg)))) if (!(reg = ast_calloc(1, sizeof(*reg))))
return -1; return -1;
reg->addr.ss.ss_family = AF_INET;
if (ast_dnsmgr_lookup(hostname, &reg->addr, &reg->dnsmgr, srvlookup ? "_iax._udp" : NULL) < 0) { if (ast_dnsmgr_lookup(hostname, &reg->addr, &reg->dnsmgr, srvlookup ? "_iax._udp" : NULL) < 0) {
ast_free(reg); ast_free(reg);
return -1; return -1;
@@ -12415,6 +12416,7 @@ static struct iax2_peer *build_peer(const char *name, struct ast_variable *v, st
peer->expire = -1; peer->expire = -1;
peer->pokeexpire = -1; peer->pokeexpire = -1;
peer->sockfd = defaultsockfd; peer->sockfd = defaultsockfd;
peer->addr.ss.ss_family = AF_INET;
if (ast_string_field_init(peer, 32)) if (ast_string_field_init(peer, 32))
peer = peer_unref(peer); peer = peer_unref(peer);
} }