]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 335320 via svnmerge from
authorKinsey Moore <kmoore@digium.com>
Mon, 12 Sep 2011 13:27:04 +0000 (13:27 +0000)
committerKinsey Moore <kmoore@digium.com>
Mon, 12 Sep 2011 13:27:04 +0000 (13:27 +0000)
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/branches/10@335321 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

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