GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GH-65056: Improve the IP address' is_global/is_private documentation by jstasiak · Pull Request #113186 · python/cpython

Conversation

@jstasiak

@jstasiak jstasiak commented Dec 15, 2023 •
edited by github-actions Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

It wasn't clear what the semantics of is_global/is_private are and, when one gets to the bottom of it, it's not quite so simple (hence the exceptions listed).

I opted to fully replace the docstrings with the content from the documentation to save myself some work.

  • Issue: ipaddress "is_private" and "is_global" are insufficiently documented and is_global probably has a bug #65056

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

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@jstasiak
pythonGH-65056: Improve the IP address' is_global/is_private document…
533b97f
…ation

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

I opted to fully replace the docstrings with the content from the
documentation to save myself some work.
@bedevere-app bedevere-app Bot added the awaiting review label Dec 15, 2023
@bedevere-app bedevere-app Bot mentioned this pull request Dec 15, 2023
ipaddress "is_private" and "is_global" are insufficiently documented and is_global probably has a bug #65056
Closed
@jstasiak

jstasiak commented Dec 15, 2023

Copy link
Copy Markdown
Contributor Author

I think the news entry can be safely skipped here.

Note that the documentation is accurate assuming that #113179 gets merged and the 100.64.0.0/10 range handling is left unchanged.

I'll adapt the documentation as needed.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou added the skip news label Mar 13, 2024
encukou
encukou reviewed Mar 13, 2024
View reviewed changes

@encukou encukou left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I'd prefer saying shared address space rather than (or in addition to) the numbers -- at least in the public docs.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Doc/library/ipaddress.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/ipaddress.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Doc/library/ipaddress.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/ipaddress.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Lib/ipaddress.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou mentioned this pull request Mar 13, 2024
GH-113171: Fix "private" (non-global) IP address ranges #113179
Merged
jstasiak and others added 5 commits March 14, 2024 00:00
@jstasiak @encukou
Update Doc/library/ipaddress.rst
497eaf9
Co-authored-by: Petr Viktorin <[email protected]>
@jstasiak @encukou
Update Doc/library/ipaddress.rst
deb8b19
Co-authored-by: Petr Viktorin <[email protected]>
@jstasiak @encukou
Update Doc/library/ipaddress.rst
d115f17
Co-authored-by: Petr Viktorin <[email protected]>
@jstasiak @encukou
Update Lib/ipaddress.py
3c6775f
Co-authored-by: Petr Viktorin <[email protected]>
@jstasiak @encukou
Update Lib/ipaddress.py
c43f0da
Co-authored-by: Petr Viktorin <[email protected]>
@jstasiak

jstasiak commented Mar 13, 2024

Copy link
Copy Markdown
Contributor Author

That's more than fair, all suggestions applied.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou
encukou merged commit 2a4cbf1 into python:main Mar 18, 2024
@bedevere-app bedevere-app Bot removed the awaiting review label Mar 18, 2024
vstinner pushed a commit to vstinner/cpython that referenced this pull request Mar 20, 2024
@jstasiak @encukou @vstinner
pythonGH-65056: Improve the IP address' is_global/is_private document…
61c1e8f
…ation (pythonGH-113186)

* pythonGH-65056: Improve the IP address' is_global/is_private documentation

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

Co-authored-by: Petr Viktorin <[email protected]>
adorilson pushed a commit to adorilson/cpython that referenced this pull request Mar 25, 2024
@jstasiak @encukou @adorilson
pythonGH-65056: Improve the IP address' is_global/is_private document…
087e7e0
…ation (pythonGH-113186)

* pythonGH-65056: Improve the IP address' is_global/is_private documentation

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

Co-authored-by: Petr Viktorin <[email protected]>
diegorusso pushed a commit to diegorusso/cpython that referenced this pull request Apr 17, 2024
@jstasiak @encukou @diegorusso
pythonGH-65056: Improve the IP address' is_global/is_private document…
bd6e3dc
…ation (pythonGH-113186)

* pythonGH-65056: Improve the IP address' is_global/is_private documentation

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

Co-authored-by: Petr Viktorin <[email protected]>
encukou added a commit to encukou/cpython that referenced this pull request Apr 23, 2024
@jstasiak @encukou
pythonGH-65056: Improve the IP address' is_global/is_private document…
12cf493
…ation (pythonGH-113186)

* pythonGH-65056: Improve the IP address' is_global/is_private documentation

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

Co-authored-by: Petr Viktorin <[email protected]>
@encukou encukou mentioned this pull request Apr 23, 2024
[3.12] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) #118177
Merged
@bedevere-app

bedevere-app Bot commented Apr 23, 2024

Copy link
Copy Markdown

GH-118177 is a backport of this pull request to the 3.12 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou mentioned this pull request Apr 23, 2024
ipaddress considers some not globally reachable addresses global and vice versa #113171
Closed
encukou added a commit that referenced this pull request Apr 24, 2024
@encukou @jstasiak
[3.12] gh-113171: gh-65056: Fix "private" (non-global) IP address ran…
f86b17a
…ges (GH-113179) (GH-113186) (GH-118177)

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

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] #61602

* GH-65056: Improve the IP address' is_global/is_private documentation (GH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

Co-authored-by: Jakub Stasiak <[email protected]>
encukou added a commit to encukou/cpython that referenced this pull request Apr 24, 2024
@encukou @jstasiak
pythongh-113171: pythongh-65056: Fix "private" (non-global) IP addres…
b47c766
…s ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
@encukou encukou mentioned this pull request Apr 24, 2024
[3.11] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) (GH-118177) #118227
Merged
encukou added a commit to encukou/cpython that referenced this pull request Apr 24, 2024
@encukou @jstasiak
pythongh-113171: pythongh-65056: Fix "private" (non-global) IP addres…
0740166
…s ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
@encukou encukou mentioned this pull request Apr 24, 2024
[3.10] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) (GH-118177) #118229
Merged
pablogsal pushed a commit that referenced this pull request Apr 25, 2024
@encukou
[3.11] gh-113171: gh-65056: Fix "private" (non-global) IP address ran…
ba43157
…ges (GH-113179) (GH-113186) (GH-118177) (#118227)
encukou added a commit to encukou/cpython that referenced this pull request May 1, 2024
@encukou @jstasiak
pythongh-113171: pythongh-65056: Fix "private" (non-global) IP addres…
5e58376
…s ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
@encukou encukou mentioned this pull request May 1, 2024
[3.9] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) (GH-118177) #118472
Merged
encukou added a commit to encukou/cpython that referenced this pull request May 1, 2024
@encukou @jstasiak
pythongh-113171: pythongh-65056: Fix "private" (non-global) IP addres…
05a1467
…s ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
@encukou encukou mentioned this pull request May 1, 2024
[3.8] gh-113171: gh-65056: Fix "private" (non-global) IP address ranges (GH-113179) (GH-113186) (GH-118177) #118479
Merged
ambv pushed a commit that referenced this pull request May 7, 2024
@encukou @jstasiak
[3.10] gh-113171: gh-65056: Fix "private" (non-global) IP address ran…
c62c9e5
…ges (GH-113179) (GH-113186) (GH-118177) (GH-118229)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] #61602

In 3.10 and below, is_private checks whether the network and broadcast
address are both private.
In later versions (where the test wss backported from), it checks
whether they both are in the same private network.

For 0.0.0.0/0, both 0.0.0.0 and 255.225.255.255 are private,
but one is in 0.0.0.0/8 ("This network") and the other in
255.255.255.255/32 ("Limited broadcast").

---------

Co-authored-by: Jakub Stasiak <[email protected]>
ambv pushed a commit that referenced this pull request May 7, 2024
@encukou @jstasiak
[3.9] gh-113171: gh-65056: Fix "private" (non-global) IP address rang…
22adf29
…es (GH-113179) (GH-113186) (GH-118177) (GH-118472)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] #61602

In 3.10 and below, is_private checks whether the network and broadcast
address are both private.
In later versions (where the test wss backported from), it checks
whether they both are in the same private network.

For 0.0.0.0/0, both 0.0.0.0 and 255.225.255.255 are private,
but one is in 0.0.0.0/8 ("This network") and the other in
255.255.255.255/32 ("Limited broadcast").

---------

Co-authored-by: Jakub Stasiak <[email protected]>
ambv pushed a commit that referenced this pull request May 7, 2024
@encukou @jstasiak
[3.8] gh-113171: gh-65056: Fix "private" (non-global) IP address rang…
895f7e2
…es (GH-113179) (GH-113186) (GH-118177) (GH-118479)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] #61602

In 3.10 and below, is_private checks whether the network and broadcast
address are both private.
In later versions (where the test wss backported from), it checks
whether they both are in the same private network.

For 0.0.0.0/0, both 0.0.0.0 and 255.225.255.255 are private,
but one is in 0.0.0.0/8 ("This network") and the other in
255.255.255.255/32 ("Limited broadcast").

---------

Co-authored-by: Jakub Stasiak <[email protected]>
@jstasiak
jstasiak deleted the improve-ipaddress-docs branch May 30, 2024 22:43
@jstasiak

jstasiak commented May 30, 2024

Copy link
Copy Markdown
Contributor Author

For visibility: I created GH-119812 to handle the Shared Address Space (100.64.0.0/10) exception documented here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

rickprice pushed a commit to ActiveState/cpython that referenced this pull request Jul 3, 2024
@encukou @rickprice
CVE-2024-4032 Fix "private" (non-global) IP address ranges (pythonGH-…
677b465
…113179) (pythonGH-113186) (pythonGH-118177)

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

pythongh-113171: pythongh-65056: Fix "private" (non-global) IP address ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

Add IPv6 addresses to suspignore.csv

That's a lot of semicolons!

(cherry picked from commit e366724)

Add notable changes
@rickprice rickprice mentioned this pull request Jul 3, 2024
CVE-2024-4032 Fix "private" (non-global) IP address ranges (GH-113179… ActiveState/cpython#57
Merged
rickprice pushed a commit to ActiveState/cpython that referenced this pull request Jul 4, 2024
@encukou @rickprice
CVE-2024-4032 Fix "private" (non-global) IP address ranges (pythonGH-…
6e7c097
…113179) (pythonGH-113186) (pythonGH-118177)

* Fix "private" (non-global) IP address ranges (pythonGH-113179) (pythonGH-113186)
(pythonGH-118177)

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

pythongh-113171: pythongh-65056: Fix "private" (non-global) IP address ranges
(pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

Add IPv6 addresses to suspignore.csv

That's a lot of semicolons!

(cherry picked from commit e366724)
rickprice pushed a commit to ActiveState/cpython that referenced this pull request Jul 8, 2024
@encukou @rickprice
CVE-2024-4032 Fix "private" (non-global) IP address ranges (pythonGH-…
89f48de
…113179) (pythonGH-113186) (pythonGH-118177)

* Fix "private" (non-global) IP address ranges (pythonGH-113179) (pythonGH-113186)
(pythonGH-118177)

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

pythongh-113171: pythongh-65056: Fix "private" (non-global) IP address ranges
(pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

Add IPv6 addresses to suspignore.csv

That's a lot of semicolons!

(cherry picked from commit e366724)
rickprice pushed a commit to ActiveState/cpython that referenced this pull request Jul 12, 2024
@encukou @rickprice
CVE-2024-4032 Fix "private" (non-global) IP address ranges (pythonGH-…
0a34c66
…113179) (pythonGH-113186) (pythonGH-118177)

* Fix "private" (non-global) IP address ranges (pythonGH-113179) (pythonGH-113186)
(pythonGH-118177)

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

pythongh-113171: pythongh-65056: Fix "private" (non-global) IP address ranges
(pythonGH-113179) (pythonGH-113186) (pythonGH-118177)

* pythonGH-113171: Fix "private" (non-global) IP address ranges (pythonGH-113179)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

* pythonGH-65056: Improve the IP address' is_global/is_private documentation (pythonGH-113186)

It wasn't clear what the semantics of is_global/is_private are and, when
one gets to the bottom of it, it's not quite so simple (hence the
exceptions listed).

(cherry picked from commit 2a4cbf1)
(cherry picked from commit 40d75c2)

---------

(cherry picked from commit f86b17a)

Co-authored-by: Jakub Stasiak <[email protected]>
(cherry picked from commit 05a1467)

Add IPv6 addresses to suspignore.csv

That's a lot of semicolons!

(cherry picked from commit e366724)
frenzymadness pushed a commit to frenzymadness/cpython that referenced this pull request Aug 13, 2024
@encukou @jstasiak @frenzymadness
00431: pythongh-113171: pythongh-65056: Fix "private" (non-global) IP…
7ef313f
… address ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177) (pythonGH-118472)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

In 3.10 and below, is_private checks whether the network and broadcast
address are both private.
In later versions (where the test wss backported from), it checks
whether they both are in the same private network.

For 0.0.0.0/0, both 0.0.0.0 and 255.225.255.255 are private,
but one is in 0.0.0.0/8 ("This network") and the other in
255.255.255.255/32 ("Limited broadcast").

---------

Co-authored-by: Jakub Stasiak <[email protected]>
frenzymadness pushed a commit to fedora-python/cpython that referenced this pull request Aug 15, 2024
@encukou @jstasiak @frenzymadness
00431: pythongh-113171: pythongh-65056: Fix "private" (non-global) IP…
71337f4
… address ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177) (pythonGH-118472)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

In 3.10 and below, is_private checks whether the network and broadcast
address are both private.
In later versions (where the test wss backported from), it checks
whether they both are in the same private network.

For 0.0.0.0/0, both 0.0.0.0 and 255.225.255.255 are private,
but one is in 0.0.0.0/8 ("This network") and the other in
255.255.255.255/32 ("Limited broadcast").

---------

Co-authored-by: Jakub Stasiak <[email protected]>
stratakis pushed a commit to stratakis/cpython that referenced this pull request Aug 15, 2024
@encukou @stratakis
00431: pythongh-113171: pythongh-65056: Fix "private" (non-global) IP…
234aea1
… address ranges (pythonGH-113179) (pythonGH-113186) (pythonGH-118177) (pythonGH-118472)

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.

100.64.0.0/10 is left alone, for now, as it's been made special in [1].

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

[1] python#61602

In 3.10 and below, is_private checks whether the network and broadcast
address are both private.
In later versions (where the test wss backported from), it checks
whether they both are in the same private network.

For 0.0.0.0/0, both 0.0.0.0 and 255.225.255.255 are private,
but one is in 0.0.0.0/8 ("This network") and the other in
255.255.255.255/32 ("Limited broadcast").
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@encukou encukou encukou left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

skip news

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jstasiak @encukou
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.