[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[gftp] Re: v2.0.15/2.0.16 fails to connect to some sites ?



Hi,
   The problem with this is gftp was trying to create a IPV6 socket and that
was failing. The site ftp.club-internet.fr must have a IPV6 address associated
with it. Here is a patch so that you can disable IPv6 support.

Brian



On Sun, Nov 09, 2003 at 05:02:35PM +0100, Robert Grasso wrote:
> Hello,
> 
> I just migrated to Mandrake 9.2, which is shipped with gftp v2.0.15. On some sites, for example 
> ftp.club-internet.fr, the connection begins, then fails. I have pasted the log at the end of the mail.
> Then I downloaded gftp-2.0.16-1.src.rpm, rebuilt it, ran it, and got the same error.I have not been able 
> to test gftp-2.0.16-1.i386.rpm as it requires libexpat.so.1 which is not in Mandrake 9.2.
> 
> I can reach this french site smoothly using ncftp or kbear.
> 
> gftp v2.0.14 from Mandrake 9.1 used to work correctly with all sites.
> 
> Two other guys complain about this issue on the Web:
> http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&client=googlet&threadm=DbSdnbD_0pTuzguiRVn-gA%40comcast.com&rnum=1&prev=/groups%3Fnum%3D50%26hl%3Den%26lr%3D%26ie%3DISO-8859-1%26client%3Dgooglet%26q%3D%2522Failed%2Bto%2Bcreate%2Ba%2Bsocket%253A%2BAddress%2Bfamily%2Bnot%2Bsupported%2Bby%2Bprotocol%2522%26sa%3DN%26tab%3Dwg
> 
> Does anybody have a hint ?
> 
> Regards
> -- 
> Robert Grasso
> @home
> ---
> UNIX was not designed to stop you from doing stupid things, because 
>   that would also stop you from doing clever things. -- Doug Gwyn
> 
> 
> Trying ftp.club-internet.fr:21
> Connected to ftp.club-internet.fr:21
> 220-FTP server ready.
> 220-You are user number 300 of 300 allowed.
> 220 Only anonymous FTP is allowed here
> USER anonymous
> 230-Bienvenue sur le ftp de... / Welcome on the ftp of...
> 230-      ____ _       _          ___       _                       _
> 230-     / ___| |_   _| |__      |_ _|_ __ | |_ ___ _ __ _ __   ___| |_
> 230-    | |   | | | | | '_ \ _____| || '_ \| __/ _ \ '__| '_ \ / _ \ __|
> 230-    | |___| | |_| | |_) |_____| || | | | ||  __/ |  | | | |  __/ |_
> 230-     \____|_|\__,_|_.__/     |___|_| |_|\__\___|_|  |_| |_|\___|\__|
> 230-
> 230-      T-Online France / Club-Internet - http://www.club-internet.fr/
> 230- 
> 230-
> 230-      !!! Utilisez de preference http://ftp.club-internet.fr/ !!!
> 230-      !!!       Please use http://ftp.club-internet.fr/       !!!
> 230-
> 230-                                              ftpmaster @ t-online.fr
> 230-**************************************************************************
> 230- POUR LES ABONNES POSSEDANT UNE PAGE PERSONNELLE, N'OUBLIEZ PAS DE FAIRE
> 230-            VOS TRANSFERTS SUR FTP://PERSO-FTP.CLUB-INTERNET.FR
> 230-**************************************************************************
> 230-
> 230 Anonymous user logged in
> SYST
> 215 UNIX Type: L8
> TYPE I
> 200 TYPE is now 8-bit binary
> PWD
> 257 "/" is your current location
> Failed to create a socket: Address family not supported by protocol
> Disconnecting from site ftp.club-internet.fr
> 
? Makefile
? Makefile.in
Index: options.h
===================================================================
RCS file: /cvs/gnome/gftp/lib/options.h,v
retrieving revision 1.20
diff -u -r1.20 options.h
--- options.h	21 Jul 2003 00:26:41 -0000	1.20
+++ options.h	10 Nov 2003 01:55:49 -0000
@@ -111,6 +111,12 @@
   {"default_protocol", N_("Default Protocol:"),
    gftp_option_type_textcombo, "FTP", NULL, 0,
    N_("This specifies the default protocol to use"), GFTP_PORT_ALL, NULL},
+#if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR)
+  {"enable_ipv6", N_("Enable IPv6"), 
+   gftp_option_type_checkbox, GINT_TO_POINTER(1), NULL, 
+   GFTP_CVARS_FLAGS_SHOW_BOOKMARK,
+   N_("Enable IPv6 support"), GFTP_PORT_ALL, NULL},
+#endif
 
   {"list_dblclk_action", "", 
    gftp_option_type_int, GINT_TO_POINTER(0), NULL, 0,
Index: protocols.c
===================================================================
RCS file: /cvs/gnome/gftp/lib/protocols.c,v
retrieving revision 1.70
diff -u -r1.70 protocols.c
--- protocols.c	8 Nov 2003 12:23:20 -0000	1.70
+++ protocols.c	10 Nov 2003 01:55:54 -0000
@@ -1826,8 +1826,8 @@
   int port, sock;
 #if defined (HAVE_GETADDRINFO) && defined (HAVE_GAI_STRERROR)
   struct addrinfo hints, *res;
+  int errnum, enable_ipv6;
   char serv[8];
-  int errnum;
 
   if ((request->use_proxy = gftp_need_proxy (request, service,
                                              proxy_hostname, proxy_port)) < 0)
@@ -1835,10 +1835,17 @@
   else if (request->use_proxy == 1)
     request->hostp = NULL;
 
+  gftp_lookup_request_option (request, "enable_ipv6", &enable_ipv6);
+
   request->free_hostp = 1;
   memset (&hints, 0, sizeof (hints));
   hints.ai_flags = AI_CANONNAME;
-  hints.ai_family = PF_UNSPEC;
+
+  if (enable_ipv6)
+    hints.ai_family = PF_UNSPEC;
+  else
+    hints.ai_family = AF_INET;
+
   hints.ai_socktype = SOCK_STREAM;
 
   if (request->use_proxy)
@@ -1926,7 +1933,7 @@
   if ((sock = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
     {
       request->logging_function (gftp_logging_error, request,
-                                 _("Failed to create a socket: %s\n"),
+                                 _("Failed to create a IPv4 socket: %s\n"),
                                  g_strerror (errno));
       return (GFTP_ERETRYABLE);
     }
Index: rfc959.c
===================================================================
RCS file: /cvs/gnome/gftp/lib/rfc959.c,v
retrieving revision 1.47
diff -u -r1.47 rfc959.c
--- rfc959.c	8 Nov 2003 12:23:20 -0000	1.47
+++ rfc959.c	10 Nov 2003 01:55:57 -0000
@@ -620,7 +620,7 @@
   if ((parms->data_connection = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
     {
       request->logging_function (gftp_logging_error, request,
-				 _("Failed to create a socket: %s\n"),
+				 _("Failed to create a IPv4 socket: %s\n"),
 				 g_strerror (errno));
       gftp_disconnect (request);
       return (GFTP_ERETRYABLE);
@@ -767,7 +767,7 @@
   if ((parms->data_connection = socket (AF_INET6, SOCK_STREAM, IPPROTO_TCP)) < 0)
     {
       request->logging_function (gftp_logging_error, request,
-				 _("Failed to create a socket: %s\n"),
+				 _("Failed to create a IPv6 socket: %s\n"),
 				 g_strerror (errno));
       gftp_disconnect (request);
       return (GFTP_ERETRYABLE);