]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)
authorJakub Stasiak <jakub@stasiak.at>
Fri, 22 Mar 2024 16:49:56 +0000 (17:49 +0100)
committerGitHub <noreply@github.com>
Fri, 22 Mar 2024 16:49:56 +0000 (17:49 +0100)
commit40d75c2b7f5c67e254d0a025e0f2e2c7ada7f69f
treee3755b9540677a0e78ae10bb36fbf4690f7d0a67
parent3be9b9d8722696b95555937bb211dc4cda714d56
GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)

* GH-113171: Fix "private" (really non-global) IP address ranges

The _private_networks variables, used by various is_private
implementations, were missing some ranges and at the same time had
overly strict ranges (where there are more specific ranges considered
globally reachable by the IANA registries).

This patch updates the ranges with what was missing or otherwise
incorrect.

I left 100.64.0.0/10 alone, for now, as it's been made special in [1]
and I'm not sure if we want to undo that as I don't quite understand the
motivation behind it.

The _address_exclude_many() call returns 8 networks for IPv4, 121
networks for IPv6.

[1] https://github.com/python/cpython/issues/61602
Doc/library/ipaddress.rst
Doc/whatsnew/3.13.rst
Lib/ipaddress.py
Lib/test/test_ipaddress.py
Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst [new file with mode: 0644]