From 48ade34c2a9f5f0e893c701ca2616cdffe33bb10 Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Tue, 18 May 2021 10:38:10 +0100 Subject: [PATCH 1/2] Drop redundant subnets The two dropped networks are wholly contained inside of 2001::/23: ```python >>> from ipaddress import IPv6Network >>> sub_tla_id = IPv6Network('2001::/23') >>> sub_tla_id.supernet_of(IPv6Network('2001:2::/48')) True >>> sub_tla_id.supernet_of(IPv6Network('2001:10::/28')) True ``` Any IP address that tests as private against either 2001:2::/48 or 2001:10::/28 will also test as private against 2001::/23, any IP address that is not part of 2001::/23 will also never be part of the other two. --- Lib/ipaddress.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/ipaddress.py b/Lib/ipaddress.py index 4a6496a5da3ef8..328f4d010caff1 100644 --- a/Lib/ipaddress.py +++ b/Lib/ipaddress.py @@ -2266,9 +2266,7 @@ class _IPv6Constants: IPv6Network('::ffff:0:0/96'), IPv6Network('100::/64'), IPv6Network('2001::/23'), - IPv6Network('2001:2::/48'), IPv6Network('2001:db8::/32'), - IPv6Network('2001:10::/28'), IPv6Network('fc00::/7'), IPv6Network('fe80::/10'), ] From 3b7ce0d2f41ba76195c4fa299e262392c87803ff Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Tue, 18 May 2021 09:59:31 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20blu?= =?UTF-8?q?rb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NEWS.d/next/Library/2021-05-18-09-59-27.bpo-44167.ujyzU4.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 Misc/NEWS.d/next/Library/2021-05-18-09-59-27.bpo-44167.ujyzU4.rst diff --git a/Misc/NEWS.d/next/Library/2021-05-18-09-59-27.bpo-44167.ujyzU4.rst b/Misc/NEWS.d/next/Library/2021-05-18-09-59-27.bpo-44167.ujyzU4.rst new file mode 100644 index 00000000000000..d06f93326bc97c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2021-05-18-09-59-27.bpo-44167.ujyzU4.rst @@ -0,0 +1 @@ +Dropped redundant network definitions from the IPv6 private networks list, which were subsets of another larger private network entry. \ No newline at end of file