Index: /pjproject/trunk/pjlib/include/pj/compat/socket.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/compat/socket.h	(revision 1610)
+++ /pjproject/trunk/pjlib/include/pj/compat/socket.h	(revision 1611)
@@ -68,5 +68,4 @@
 #   endif
 
-#   undef s_addr
 #   define PJ_SOCK_HAS_GETADDRINFO  1
 #endif	/* _MSC_VER */
@@ -147,7 +146,8 @@
 
 /*
- * And undefine this..
+ * And undefine these..
  */
 #undef s_addr
+#undef s6_addr
 
 /*
Index: /pjproject/trunk/pjlib/src/pj/ip_helper_generic.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/ip_helper_generic.c	(revision 1610)
+++ /pjproject/trunk/pjlib/src/pj/ip_helper_generic.c	(revision 1611)
@@ -83,5 +83,5 @@
     for (i=0; i<count; ++i) {
 	struct ifreq *itf = &ifr[i];
-	struct sockaddr *ad = itf->ifr_addr;
+	struct sockaddr *ad = &itf->ifr_addr;
 	
 	ifs[i].addr.sa_family = ad->sa_family;
Index: /pjproject/trunk/pjnath/src/pjstun-client/client_main.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjstun-client/client_main.c	(revision 1610)
+++ /pjproject/trunk/pjnath/src/pjstun-client/client_main.c	(revision 1611)
@@ -232,5 +232,5 @@
 static int init()
 {
-    pj_sockaddr_in addr;
+    pj_sockaddr addr;
     pj_stun_session_cb stun_cb;
     int len;
@@ -283,8 +283,8 @@
     pj_assert(status == PJ_SUCCESS);
 
-    status = pj_sockaddr_in_init(&addr, NULL, 0);
+    status = pj_sockaddr_in_init(&addr.ipv4, NULL, 0);
     pj_assert(status == PJ_SUCCESS);
 
-    addr.sin_port = pj_htons((pj_uint16_t)LOCAL_PORT);
+    addr.ipv4.sin_port = pj_htons((pj_uint16_t)LOCAL_PORT);
     status = pj_sock_bind(g.sock, &addr, sizeof(addr));
     pj_assert(status == PJ_SUCCESS);
@@ -294,10 +294,10 @@
     pj_assert(status == PJ_SUCCESS);
 
-    PJ_LOG(3,(THIS_FILE, "Listening on port %d", (int)pj_ntohs(addr.sin_port)));
+    PJ_LOG(3,(THIS_FILE, "Listening on port %d", (int)pj_ntohs(addr.ipv4.sin_port)));
 
     len = sizeof(g.peer_addr);
     status = pj_sock_getsockname(g.peer_sock, &g.peer_addr, &len);
     if (g.peer_addr.sin_addr.s_addr == 0)
-	pj_gethostip(&g.peer_addr.sin_addr);
+	pj_gethostip(pj_AF_INET(), (pj_sockaddr*)&g.peer_addr.sin_addr);
 
     PJ_LOG(3,(THIS_FILE, "Peer is on port %d", (int)pj_ntohs(g.peer_addr.sin_port)));
@@ -550,5 +550,5 @@
     pj_str_t ip;
     pj_uint16_t port;
-    pj_sockaddr_in tmp_addr;
+    pj_sockaddr tmp_addr;
 
     pos = pj_ansi_strchr(input, ':');
@@ -567,10 +567,10 @@
     }
 
-    if (pj_sockaddr_in_init(&tmp_addr, &ip, port)!=PJ_SUCCESS) {
+    if (pj_sockaddr_in_init(&tmp_addr.ipv4, &ip, port)!=PJ_SUCCESS) {
 	puts("Invalid address");
 	return -1;
     }
 
-    pj_memcpy(addr, &tmp_addr, sizeof(tmp_addr));
+    pj_memcpy(addr, &tmp_addr, sizeof(pj_sockaddr_in));
 
     return PJ_SUCCESS;
Index: /pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c
===================================================================
--- /pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c	(revision 1610)
+++ /pjproject/trunk/pjnath/src/pjstun-srv-test/turn_usage.c	(revision 1611)
@@ -770,5 +770,5 @@
 
     if (client->alloc_addr.sin_addr.s_addr == 0) {
-	status = pj_gethostip(&client->alloc_addr.sin_addr);
+	status = pj_gethostip(pj_AF_INET(), (pj_sockaddr*)&client->alloc_addr.sin_addr);
 	if (status != PJ_SUCCESS) {
 	    pj_sock_close(client->sock);
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 1610)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport.c	(revision 1611)
@@ -39,4 +39,13 @@
 #if 0
 #   define TRACE_(x)	PJ_LOG(5,x)
+
+static const char *addr_string(const pj_sockaddr_t *addr)
+{
+    static char str[PJ_INET6_ADDRSTRLEN];
+    pj_inet_ntop(((const pj_sockaddr*)addr)->addr.sa_family, 
+		 pj_sockaddr_get_addr(addr),
+		 str, sizeof(str));
+    return str;
+}
 #else
 #   define TRACE_(x)
@@ -179,16 +188,4 @@
 
 
-/*
- * Tools to get address string.
- */
-static const char *addr_string(const pj_sockaddr_t *addr)
-{
-    static char str[PJ_INET6_ADDRSTRLEN];
-    pj_inet_ntop(((const pj_sockaddr*)addr)->addr.sa_family, 
-		 pj_sockaddr_get_addr(addr),
-		 str, sizeof(str));
-    return str;
-}
-
 
 /*
Index: /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c	(revision 1610)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_transport_tls_ossl.c	(revision 1611)
@@ -992,11 +992,11 @@
 	 */
 	if (listener_addr->sin_addr.s_addr == 0) {
-	    pj_in_addr hostip;
-
-	    status = pj_gethostip(&hostip);
+	    pj_sockaddr hostip;
+
+	    status = pj_gethostip(pj_AF_INET(), &hostip);
 	    if (status != PJ_SUCCESS)
 		goto on_error;
 
-	    listener_addr->sin_addr = hostip;
+	    listener_addr->sin_addr = hostip.ipv4.sin_addr;
 	}
 
