[asterisk-scf-commits] asterisk-scf/release/pjproject.git branch "veesix" updated.

Commits to the Asterisk SCF project code repositories asterisk-scf-commits at lists.digium.com
Tue Dec 7 10:36:51 CST 2010


branch "veesix" has been updated
       via  ffcd8fab13759c52e07e3eddcadfaeed8d278bf1 (commit)
      from  98182890c2ce1de82d160a6f7106a2c2a6179b27 (commit)

Summary of changes:
 pjsip/src/test/transport_test.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)


- Log -----------------------------------------------------------------
commit ffcd8fab13759c52e07e3eddcadfaeed8d278bf1
Author: Mark Michelson <mmichelson at digium.com>
Date:   Tue Dec 7 10:42:18 2010 -0600

    Add an extra check to be sure we aren't trying to transport to [::]

diff --git a/pjsip/src/test/transport_test.c b/pjsip/src/test/transport_test.c
index 72f9249..9072537 100644
--- a/pjsip/src/test/transport_test.c
+++ b/pjsip/src/test/transport_test.c
@@ -34,7 +34,7 @@ int generic_transport_test(pjsip_transport *tp)
     PJ_LOG(3,(THIS_FILE, "  structure test..."));
 
     /* Check that local address name is valid. */
-    {
+    if (tp->local_addr.addr.sa_family == pj_AF_INET6()) {
 	struct pj_in_addr addr;
 
 	/* Note: inet_aton() returns non-zero if addr is valid! */
@@ -48,6 +48,20 @@ int generic_transport_test(pjsip_transport *tp)
 	     * IP address.
 	     */
 	}
+    } else {
+        pj_in6_addr addr6;
+        if (pj_inet_pton(pj_AF_INET6(), &tp->local_name.host, &addr6) == PJ_SUCCESS) {
+            pj_uint8_t zero_addr[16];
+            pj_bzero(zero_addr, sizeof(zero_addr));
+            if (pj_memcmp(&addr6, zero_addr, sizeof(addr6))) {
+                PJ_LOG(3, (THIS_FILE, "  Error: invalid address name"));
+                return -425;
+            }
+        } else {
+            /* It's okay. local_name.host may be a hostname instead of
+	     * IP address.
+	     */
+        }
     }
 
     /* Check that port is valid. */

-----------------------------------------------------------------------


-- 
asterisk-scf/release/pjproject.git



More information about the asterisk-scf-commits mailing list