Ignatios Souvatzis
2012-06-28 16:51:21 UTC
Hi,
a discussion on tech-user@ has reminded me that the same perceived problem
came up at least one time in the past.
When a peer name resolves to multiple addresses, and the first one
in the list is not reachable, ftp tries the next one until the list
is exausted or a connection succeeds. (This can happen often on
the current network, when servers have e.g. one or multiple IPv6
and IPv4 address records in DNS, and the client doesn't have
connectivity for one of the address families).
This works fine per default - here's output from my test setup:
# ftp ftp.netbsd.org
Trying 2001:470:1f05:3d::21:21 ...
ftp: Can't connect to `2001:470:1f05:3d::21:21': No route to host
Trying 199.233.217.249:21 ...
Connected to ftp.netbsd.org.
220 ftp.NetBSD.org FTP server (NetBSD-ftpd 20100320) ready.
Name (ftp.netbsd.org:root):
However, if the verbose mode is switched off (e.g. through the
Name (ftp.netbsd.org:ignatios):
Note that we get an error message and then a prompt for auth
information. How are those related? The "Name" prompt is not for
the address mentioned on the line above!
My proposal is to suppress, in terse mode only, the error message
*for EHOSTUNREACH* if we still have more addresses to try.
The verbose output from above doesn't change (in fact, it's from my
patched ftp); the terse one changes to this:
# ftp -V ftp.netbsd.org
Name (ftp.netbsd.org:root):
I do not think that other errors should be suppressed in any case.
The exception for EHOSTUNREACH is IMO warranted because it's a
condition that will show up often; and the user has explicitly asked
to not be bothered with non-fatal messages.
Diff is appended.
Regards,
-is
a discussion on tech-user@ has reminded me that the same perceived problem
came up at least one time in the past.
When a peer name resolves to multiple addresses, and the first one
in the list is not reachable, ftp tries the next one until the list
is exausted or a connection succeeds. (This can happen often on
the current network, when servers have e.g. one or multiple IPv6
and IPv4 address records in DNS, and the client doesn't have
connectivity for one of the address families).
This works fine per default - here's output from my test setup:
# ftp ftp.netbsd.org
Trying 2001:470:1f05:3d::21:21 ...
ftp: Can't connect to `2001:470:1f05:3d::21:21': No route to host
Trying 199.233.217.249:21 ...
Connected to ftp.netbsd.org.
220 ftp.NetBSD.org FTP server (NetBSD-ftpd 20100320) ready.
Name (ftp.netbsd.org:root):
However, if the verbose mode is switched off (e.g. through the
ftp -V ftp.netbsd.org
ftp: Can't connect to `2001:470:1f05:3d::21:21': No route to hostName (ftp.netbsd.org:ignatios):
Note that we get an error message and then a prompt for auth
information. How are those related? The "Name" prompt is not for
the address mentioned on the line above!
My proposal is to suppress, in terse mode only, the error message
*for EHOSTUNREACH* if we still have more addresses to try.
The verbose output from above doesn't change (in fact, it's from my
patched ftp); the terse one changes to this:
# ftp -V ftp.netbsd.org
Name (ftp.netbsd.org:root):
I do not think that other errors should be suppressed in any case.
The exception for EHOSTUNREACH is IMO warranted because it's a
condition that will show up often; and the user has explicitly asked
to not be bothered with non-fatal messages.
Diff is appended.
Regards,
-is