Skip to content

gh-111442: Use first_address and last_address internally, and refer to them in IPv4 and IPv6 networks as network_address, subnet_router_anycast or broadcast_address only if appropriate to the address family. #132420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from

Conversation

davidgroves
Copy link

@davidgroves davidgroves commented Apr 11, 2025

Use the correct langauge for the all 0's and all 1's addresses in networking.

For example, IPv6Networks don't have a network or a broadcast address. While the subnet_router_anycast address has all the host bits set to 0, you would expect to see packets on the wire addressed to it, where in IPv4 you would not expect to see packets addressed to the network_address. The all 1's host address in IPv6 has no special meaning.

This change deprecates the use of network_address or broadcast_address for IPv6Networks, and introduces the subnet_router_anycast_address property.

Internally, it does this by changing most previous occurances in the NetworkBase class for network_address to first_address and broadcast_address to last_address, and using the address family specific names in each address families class.


📚 Documentation preview 📚: https://cpython-previews--132420.org.readthedocs.build/

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

Successfully merging this pull request may close these issues.

1 participant