]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix possible error on stringification of IPv4-mapped addrs
authorTerry Wilson <twilson@digium.com>
Thu, 18 Aug 2011 21:26:01 +0000 (21:26 +0000)
committerTerry Wilson <twilson@digium.com>
Thu, 18 Aug 2011 21:26:01 +0000 (21:26 +0000)
The FreeBSD netsock2 test has been failing for a while. We were
pasing sa->len to getnameinfo instead of sa_tmp->len.

ASTERISK-18289

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@332559 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/netsock2.c

index af408ddaa281e42ee08f5f7e5b72cae139195e0c..40d32db5549b062434a57006b9f2f3db5f8e6672 100644 (file)
@@ -85,7 +85,7 @@ char *ast_sockaddr_stringify_fmt(const struct ast_sockaddr *sa, int format)
                sa_tmp = sa;
        }
 
-       if ((e = getnameinfo((struct sockaddr *)&sa_tmp->ss, sa->len,
+       if ((e = getnameinfo((struct sockaddr *)&sa_tmp->ss, sa_tmp->len,
                             format & AST_SOCKADDR_STR_ADDR ? host : NULL,
                             format & AST_SOCKADDR_STR_ADDR ? sizeof(host) : 0,
                             format & AST_SOCKADDR_STR_PORT ? port : 0,