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-155140: Fix ipaddress.IPv6Address.is_link_local to require the strict fe80::/64 range by Sudeep-A-Kulkarni · Pull Request #155384 · python/cpython

Conversation

@Sudeep-A-Kulkarni

@Sudeep-A-Kulkarni Sudeep-A-Kulkarni commented Aug 8, 2026

Copy link
Copy Markdown

Fixes gh-155140.

Bug description:

ipaddress.IPv6Address.is_link_local currently checks membership in the broad fe80::/10 block, but per RFC 4291 section 2.5.6 a true link-local address must have the first 64 bits equal to fe80:: exactly (10-bit prefix followed by 54 zero bits). This means addresses that fall inside fe80::/10 but outside fe80::/64 are incorrectly reported as link-local.

Reproducer:

import ipaddress
ipaddress.IPv6Address("fe80:6666:6666:6666:6666:6666:6666:6666").is_link_local

Current output on main: True
Expected output: False

Fix:

Change _IPv6Constants._linklocal_network from fe80::/10 to fe80::/64, matching the strict RFC 4291 definition.

Testing:

Updated the existing testReservedIpv6 assertions for fea0:: and febf:ffff:: (previously expected True, now correctly False since they fall outside fe80::/64), and added regression tests for fe80:: (still True) and the originally reported fe80:6666:... address (now False), for both ipaddress.ip_network and ipaddress.ip_address.

Sorry, something went wrong.

Uh oh!

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

All reactions
Sudeep-A-Kulkarni added 2 commits August 8, 2026 11:35
@Sudeep-A-Kulkarni
pythongh-155140: Fix IPv6Address.is_link_local to require the strict …
f9a347e
…fe80::/64 range
@Sudeep-A-Kulkarni
Update link-local address assertions in tests
6b3e39d
@bedevere-app

bedevere-app Bot commented Aug 8, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bedevere-app bedevere-app Bot mentioned this pull request Aug 8, 2026
"fe80:6666:6666:6666:6666:6666:6666:6666" is not a valid IPv6 link-local address #155140
Open
@bedevere-app bedevere-app Bot added the awaiting review label Aug 8, 2026
@picnixz

picnixz commented Aug 8, 2026

Copy link
Copy Markdown
Member

@simitana Avoid low-quality review comments entirely generated by an LLM, it neither gives confidence in the comment nor does it actually help. It also restates unnecessary constraints that the OP can clearly see by looking at the CI.

All reactions

Sorry, something went wrong.

Uh oh!

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

@Sudeep-A-Kulkarni
Merge branch 'main' into patch-1
6db79df
@bedevere-app

bedevere-app Bot commented Aug 12, 2026

Copy link
Copy Markdown

Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool.

If this change has little impact on Python users, wait for a maintainer to apply the skip news label instead.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions

github-actions Bot commented Nov 12, 2026

Copy link
Copy Markdown

This PR is stale because it has been open for 90 days with no activity.

All reactions

Sorry, something went wrong.

Uh oh!

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

@github-actions github-actions Bot added the stale Stale PR or inactive for long period of time. label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

awaiting review stale Stale PR or inactive for long period of time.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

"fe80:6666:6666:6666:6666:6666:6666:6666" is not a valid IPv6 link-local address

Uh oh!

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

2 participants

@Sudeep-A-Kulkarni @picnixz
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.