jupyter / jupyter_client

Jupyter protocol client APIs
https://jupyter-client.readthedocs.io
BSD 3-Clause "New" or "Revised" License
383 stars 283 forks source link

don't include link-local addresses (169.254) in public_ips #1040

Closed minrk closed 1 week ago

minrk commented 2 weeks ago

public_ips() is meant to return addresses which might be connectable from other machines, which link-local are not.

closes #1039

minrk commented 2 weeks ago

No worries! I added the conditions to avoid link-local addresses being assigned to LOCALHOST. So I could add the or, but then I'd have to move the LOCALHOST to its own condition with the same match minus 169.

There is a lot of duplication here, so maybe I'll try to consolidate the whole thing.

minrk commented 2 weeks ago

consolidated to _populate_from_dict since netifaces and psutil were essentially the same.

ivanov commented 1 week ago

thanks, Min, for the patch, the explanation, and the additional cleanup :tada:

minrk commented 1 week ago

Thanks for the review and merge!