--- gftp-2.0.19/lib/rfc959.c	2008-03-04 13:02:48.000000000 +0100
+++ gftp-workingcopy/lib/rfc959.c	2012-08-26 11:18:10.000000000 +0200
@@ -935,7 +935,7 @@
           return (GFTP_EFATAL);
         }
 
-      memcpy (&data_addr, request->remote_addr, request->remote_addr_len);
+      memcpy (&data_addr.sin6_addr, request->remote_addr, request->remote_addr_len);
       data_addr.sin6_port = htons (port);
 
       if (connect (parms->data_connection, (struct sockaddr *) &data_addr, 
--- gftp-2.0.19/lib/socket-connect-getaddrinfo.c	2008-03-28 00:29:26.000000000 +0100
+++ gftp-workingcopy/lib/socket-connect-getaddrinfo.c	2012-08-26 11:29:21.000000000 +0200
@@ -26,6 +26,7 @@
 get_port (struct addrinfo *addr)
 {
   struct sockaddr_in * saddr;
+  struct sockaddr_in6 * saddr6;
   int port;
 
   if (addr->ai_family == AF_INET)
@@ -33,6 +34,11 @@
       saddr = (struct sockaddr_in *) addr->ai_addr;
       port = ntohs (saddr->sin_port);
     }
+  else if (addr->ai_family == AF_INET6)
+  {
+      saddr6 = (struct sockaddr_in6*) addr->ai_addr;
+      port = ntohs(saddr6->sin6_port);
+  }
   else
     port = 0;
 
@@ -145,8 +151,15 @@
 
   request->remote_addr_len = current_hostp->ai_addrlen;
   request->remote_addr = g_malloc0 (request->remote_addr_len);
-  memcpy (request->remote_addr, &((struct sockaddr_in *) current_hostp->ai_addr)->sin_addr,
-          request->remote_addr_len);
+
+  if (current_hostp->ai_family == AF_INET) {
+      memcpy (request->remote_addr, &((struct sockaddr_in *) current_hostp->ai_addr)->sin_addr,
+              request->remote_addr_len);
+  }
+  else if (current_hostp->ai_family == AF_INET6) {
+      memcpy (request->remote_addr, &((struct sockaddr_in6 *) current_hostp->ai_addr)->sin6_addr,
+              request->remote_addr_len);
+  }
 
   request->logging_function (gftp_logging_misc, request,
                              _("Connected to %s:%d\n"), res[0].ai_canonname,
