]> granicus.if.org Git - curl/commitdiff
Peter Sylvester pointed out a flaw in the AllowServerConnect() in the FTP
authorDaniel Stenberg <daniel@haxx.se>
Tue, 22 Aug 2006 21:21:01 +0000 (21:21 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 22 Aug 2006 21:21:01 +0000 (21:21 +0000)
code when doing pure ipv6 EPRT connections.

CHANGES
RELEASE-NOTES
lib/ftp.c

diff --git a/CHANGES b/CHANGES
index 470039344856c2afb8e5a5b98a0a04608d17a082..ceffd3609f6f5af2a6f522b9fa5d971060ac76e0 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,10 @@
 
                                   Changelog
 
+Daniel (22 August 2006)
+- Peter Sylvester pointed out a flaw in the AllowServerConnect() in the FTP
+  code when doing pure ipv6 EPRT connections.
+
 Daniel (19 August 2006)
 - Based on a patch by Armel Asselin, the FTP code no longer re-issues the TYPE
   command on subsequent requests on a re-used connection unless it has to.
index 1042965377b5c329d4f1933c935ce40848e862e2..7b74752db50944c00ff6526fbb114fc10c631818 100644 (file)
@@ -16,6 +16,7 @@ This release includes the following changes:
 
 This release includes the following bugfixes:
 
+ p (FTP) EPRT transfers with IPv6 didn't work properly
  o (FTP) SINGLECWD mode and using files in the root dir
  o (HTTP) Expect: header disabling work better
  o (HTTP) "Expect: 100-continue" disable on second POST on re-used connection
@@ -32,6 +33,7 @@ New curl mirrors:
 This release would not have looked like this without help, code, reports and
 advice from friends like these:
 
- Domenico Andreoli, Armel Asselin, Gisle Vanem, Yang Tse, Andrew Biggs
+ Domenico Andreoli, Armel Asselin, Gisle Vanem, Yang Tse, Andrew Biggs,
+ Peter Sylvester
 
         Thanks! (and sorry if I forgot to mention someone)
index 62c941e5d535313d7cb46606e8778891982421f9..bfa34bae846198ab2d14e8d3a6a79a9a73be24e1 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -215,8 +215,12 @@ static CURLcode AllowServerConnect(struct connectdata *conn)
     /* we have received data here */
     {
       curl_socket_t s = CURL_SOCKET_BAD;
-      socklen_t size = (socklen_t) sizeof(struct sockaddr_in);
+#ifdef ENABLE_IPV6
+      struct Curl_sockaddr_storage add;
+#else
       struct sockaddr_in add;
+#endif
+      socklen_t size = (socklen_t) sizeof(add);
 
       if(0 == getsockname(sock, (struct sockaddr *) &add, &size))
         s=accept(sock, (struct sockaddr *) &add, &size);