Bug 163773
| Summary: | ftp: connect: Invalid argument after kernel update | ||
|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Martin Burchell <martinburchell+bug> |
| Component: | ftp | Assignee: | Petr Raszyk <praszyk> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Ben Levenson <benl> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3 | CC: | kucharsk, nalin, reg.bugs, wtogami |
| Target Milestone: | --- | ||
| Target Release: | --- | ||
| Hardware: | i686 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | 0.17 Rel. 27 | Doc Type: | Bug Fix |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2005-08-22 15:17:02 UTC | Type: | --- |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Martin Burchell
2005-07-20 22:10:42 UTC
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
|