From Bugzilla Helper: User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Fedora/1.0.4-1.3.1 Firefox/1.0.4 Description of problem: Since I installed the kernel update kernel-2.6.12-1.1372_FC3 I can connect to an ftp server but I get the error "ftp: connect: Invalid argument" if I try anything else This happens on both FTP servers I've tried. If I reboot with kernel-2.6.11-1.35_FC3 ftp works fine as before. Version-Release number of selected component (if applicable): kernel-2.6.12-1.1372_FC3 How reproducible: Always Steps to Reproduce: Connect to ftp site and try ls, get or put Actual Results: Get message: ftp: connect: Invalid argument Unable to list, download or upload files Expected Results: Should be able to list, download or upload files Additional info: ftp-0.17-22 This is just an example: $ ftp foo.bar.com Connected to foo.bar.com (...). 220- 220-################################################################## 220- 220- Welcome to foo.bar.com 220- 220-################################################################## 220- 220 foo.bar.com FTP server ready 331 Password required for spooky. 230 User spooky logged in. Remote system type is UNIX. Using binary mode to transfer files. ftp> ls 227 Entering Passive Mode (...) ftp: connect: Invalid argument
The same problem here. Output from strace: connect(5, {sa_family=AF_INET, sin_port=htons(39625), sin_addr=inet_addr("192.168.1.2")}, 28) = -1 EINVAL (Invalid argument)
ncftp works fine so I'm using that instead
I just upgraded to FC4, including the latest updates and ftp appears to work OK kernel-2.6.12-1.1398_FC4 ftp-0.17-26
Also lftp works fine, I can download/upload files with it.
Nalin, this looks like an FC3 dupe of the devel bug at 158234
Same problem here, sftp also works just fine.
(In reply to comment #6) > Same problem here, sftp also works just fine. Confirmed that ftp-0.17-26 fixes the problem, so this does indeed look to be a dup of 158234.
The patch (bug #158234) does instead of: printf ("%ld\n", my_long); only this: printf ("%ld\n", (long)my_long); A cosmetic thing (user info). Back to your issue. In your case/example a 'connect' fails. A function from socket-library (library outside ftp-client). In your case this function returns error-code (error-code == errno == EINVAL == Invalid argument). This indicates a wrong parametr-value to function 'connect()'. Here is a posix-man-page: EINVAL The address_len argument is not a valid length for the address family; or invalid address family in the sockaddr structure. I have inserted 'trace' in ftp source (ftp ftp-0.17-26, FEDORA CORE 4) and here is output: PID=10714: ftp.PRO: ftp.c: initconn(): 1717: errno=0: connect OK: su_family=AF_INTE PID=10714: ftp.PRO: ftp.c: initconn(): 1720: errno=0: connect OK: sizeof (su_sin6)=>28< PID=10714: ftp.PRO: ftp.c: initconn(): 1721: errno=0: connect OK: .su_port=>56805< The same values as in your case (note: port can be different). This 'bug' can not be reproduced on FEDORA CORE 4. It is possible, that the kernel-2.6.12-1.1372_FC3 udate was wrong.
Petr, if it's an AF_INET socket, the size of the socket address should be sizeof(struct sockaddr_in), not sizeof(struct sockaddr_in6), but ftp was always passing the size of a union of the two, which is larger. The kernel didn't return an error before, but it's a bug in the FTP client to assume that it wouldn't.
Nalin, my 'trace' was not precise. The 'connect()' call in the file ftp.c, in the function initconn(): (initconn() will be called by "ls" ftp-command) if (connect(data, (struct sockaddr *) &data_addr, (data_addr.su_family == AF_INET ? sizeof(data_addr.su_sin) : sizeof(data_addr.su_sin6)))<0 ) { perror ("ftp: connect"); return (1); } If we have AF_INET, third parameter to connect() is sizeof (.su_sin). If we have AF_INET6, third parameter to connect() is sizeof (.su_sin6). NOTE: second case must be AF_INET6: In the function hook() is macro used #define ex_af2prot(a) (a == AF_INET ? 1 : (a == AF_INET6 ? 2 : 0))
Petr, it's tricky. The code you list is the correct code, but that's not what's in the version of the ftp package we have on FC3.
Nalin, you are right. An old patch (netkit-ftp.usagi-ipv6.patch) helps. You can: Install FEDORA CORE 4 or Install (current) ftp-client 0.17 (Release 27) It works on FEDORA CORE 4, FEDORA CORE 3 (at least). Petr Raszyk