Skip to content

Conversation

@9001
Copy link

@9001 9001 commented Aug 22, 2025

this should fix #664, where clients would get rejected if they connected from a link-local IPv6-address (fe80: through febf:). I'm not sure if this is the optimal way to fix this, but I believe it is at least sound :-)

I didn't add a test for this, since I think it would require an IPv6 link-local address to connect from, and I'm not sure how to assign one without running the test as root.

The tests did not seem any worse for the wear on either Windows, Linux, or Macos -- on Linux I did have to replace net_connections with connections in pyftpdlib/test/*.py and on Macos there was a small number of seemingly unrelated issues; pyftpdlib-test-macos.txt

include the scope-id when binding an IPv6 socket,
as required for IPv6 link-local addresses.

Not doing this would make the OS reject the bind
and throw an exception, disconnecting the client.
@giampaolo
Copy link
Owner

giampaolo commented Aug 22, 2025

This looks convoluted. I am not sure when I will have the resources to look at this. I feel like this belongs to ioloop.py file, and a is_local_ipv6() helper function would make things clearer, but I can't say more than this for now. IPv6 is hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants