rsmills36 / pyftpdlib

Automatically exported from code.google.com/p/pyftpdlib
Other
0 stars 0 forks source link

IPv6 server rejects IPv4 data connections #269

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Run a server on "::" address
2.Try to connect from IPv4 client

What is the expected output?
It should work :-)
I think the problem is on this line -> 
https://code.google.com/p/pyftpdlib/source/browse/trunk/pyftpdlib/handlers.py?r=
1171#315
It should check for ::FFFF: prefix for IPv4 address

What do you see instead?
Error: Rejected data connection from foreign address ::ffff:IPv4_address:port

I have to use "permit_foreign_addresses" flag, but I don't think it is a good 
solution.

What version of pyftpdlib are you using? On what operating system? Which
Python version?
pyftpdlib - 1.2.0
python - 2.7.3 on Debian Wheezy

Original issue reported on code.google.com by wee...@gmail.com on 22 Aug 2013 at 2:17

GoogleCodeExporter commented 9 years ago
Can you please provide a patch?

Original comment by g.rodola on 23 Aug 2013 at 11:18

GoogleCodeExporter commented 9 years ago
It turned out the problem was in masquerade_address_map. ::FFFF: is prepended 
everywhere for IPv4 addresses, so none of the entries in my map matched the 
local IP. As a result FTP server was sending its own local IP and it din't 
match the IP of control connection. 

Maybe it is worth putting as a note somewhere. There is not need to do any 
changes in the code.

Original comment by wee...@gmail.com on 27 Aug 2013 at 9:55

GoogleCodeExporter commented 9 years ago
Ok thanks. Closing this out.

Original comment by g.rodola on 28 Aug 2013 at 12:05