Index: nanoftp.c
--- nanoftp.c.orig	2010-11-04 11:36:31.000000000 +0100
+++ nanoftp.c	2010-11-05 22:40:32.000000000 +0100
@@ -1382,7 +1382,7 @@
 
     memset (&dataAddr, 0, sizeof(dataAddr));
 #ifdef SUPPORT_IP6
-    if ((ctxt->ftpAddr).ss_family == AF_INET6) {
+    if (((struct sockaddr *)&ctxt->ftpAddr)->sa_family == AF_INET6) {
 	ctxt->dataFd = socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP);
 	((struct sockaddr_in6 *)&dataAddr)->sin6_family = AF_INET6;
 	dataAddrLen = sizeof(struct sockaddr_in6);
@@ -1401,7 +1401,7 @@
 
     if (ctxt->passive) {
 #ifdef SUPPORT_IP6
-	if ((ctxt->ftpAddr).ss_family == AF_INET6)
+	if (((struct sockaddr *)&ctxt->ftpAddr)->sa_family == AF_INET6)
 	    snprintf (buf, sizeof(buf), "EPSV\r\n");
 	else
 #endif
@@ -1432,7 +1432,7 @@
 	cur = &ctxt->controlBuf[ctxt->controlBufAnswer]; 
 	while (((*cur < '0') || (*cur > '9')) && *cur != '\0') cur++;
 #ifdef SUPPORT_IP6
-	if ((ctxt->ftpAddr).ss_family == AF_INET6) {
+	if (((struct sockaddr *)&ctxt->ftpAddr)->sa_family == AF_INET6) {
 	    if (sscanf (cur, "%u", &temp[0]) != 1) {
 		__xmlIOErr(XML_FROM_FTP, XML_FTP_EPSV_ANSWER,
 			"Invalid answer to EPSV\n");
@@ -1469,7 +1469,7 @@
     } else {
         getsockname(ctxt->dataFd, (struct sockaddr *) &dataAddr, &dataAddrLen);
 #ifdef SUPPORT_IP6
-	if ((ctxt->ftpAddr).ss_family == AF_INET6)
+	if (((struct sockaddr *)&ctxt->ftpAddr)->sa_family == AF_INET6)
 	    ((struct sockaddr_in6 *)&dataAddr)->sin6_port = 0;
 	else
 #endif
@@ -1488,7 +1488,7 @@
 	    return INVALID_SOCKET;
 	}
 #ifdef SUPPORT_IP6
-	if ((ctxt->ftpAddr).ss_family == AF_INET6) {
+	if (((struct sockaddr *)&ctxt->ftpAddr)->sa_family == AF_INET6) {
 	    char buf6[INET6_ADDRSTRLEN];
 	    inet_ntop (AF_INET6, &((struct sockaddr_in6 *)&dataAddr)->sin6_addr,
 		    buf6, INET6_ADDRSTRLEN);
