summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorJakub Stasiak <jakub@stasiak.at>2024-03-22 16:49:56 (GMT)
committerGitHub <noreply@github.com>2024-03-22 16:49:56 (GMT)
commit40d75c2b7f5c67e254d0a025e0f2e2c7ada7f69f (patch)
treee3755b9540677a0e78ae10bb36fbf4690f7d0a67 /Misc
parent3be9b9d8722696b95555937bb211dc4cda714d56 (diff)
downloadcpython-40d75c2b7f5c67e254d0a025e0f2e2c7ada7f69f.zip
cpython-40d75c2b7f5c67e254d0a025e0f2e2c7ada7f69f.tar.gz
cpython-40d75c2b7f5c67e254d0a025e0f2e2c7ada7f69f.tar.bz2
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
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst9
1 files changed, 9 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst b/Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst
new file mode 100644
index 0000000..f9a7247
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2024-03-14-01-38-44.gh-issue-113171.VFnObz.rst
@@ -0,0 +1,9 @@
+Fixed various false positives and false negatives in
+
+* :attr:`ipaddress.IPv4Address.is_private` (see these docs for details)
+* :attr:`ipaddress.IPv4Address.is_global`
+* :attr:`ipaddress.IPv6Address.is_private`
+* :attr:`ipaddress.IPv6Address.is_global`
+
+Also in the corresponding :class:`ipaddress.IPv4Network` and :class:`ipaddress.IPv6Network`
+attributes.