Merged revisions 335321 via svnmerge from
authorKinsey Moore <kmoore@digium.com>
Mon, 12 Sep 2011 13:27:45 +0000 (13:27 +0000)
committerKinsey Moore <kmoore@digium.com>
Mon, 12 Sep 2011 13:27:45 +0000 (13:27 +0000)
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

channels/chan_iax2.c

index da00e01..3d671bc 100644 (file)
@@ -8573,6 +8573,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;
@@ -12415,6 +12416,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);
        }