Hi > I could be on a private subnet which is the same private > subnet as the server. But, we could be in different locations. > > In that case, the solution below won't work. > > How about we do this: > > If (The IP given by the server is a private address) > Always use the IP given by the call to > the connect command. > else > Use the IP given by the server. > > That should fix this problem.
I wouldn't do so. That SERVER is broken and needs to be fixed. There is nothing a client can do. Please DO NOT try to handle that on the client. You cannot. First, there are cases where servers actually USE different IPs for control and data connections, which is absolutely legal. (It is even essential if you use FXP capabilities, which is basically pure FTP with 2 servers involved.) Second, there ARE cases where servers with public OR private ips are NATed to private IPs. [And maybe even from one private ip to another private ip.] If you even happen to be on the same subnet as such a server, you still want to be able to connect. Again, the server is broken. Get it fixed. Or reject to use it. DON'T CHANGE THE CLIENT. Especially don't give it any strange semantic rules, that make understanding problems impossible, if there is ever a situation that you didn't expect. If at all, give the use a change to optionally overwrite used IPs. Regards, Steffen
smime.p7s
Description: S/MIME cryptographic signature