Uh oh!
There was an error while loading. Please reload this page.
gh-155140: Fix ipaddress.IPv6Address.is_link_local to require the strict fe80::/64 range - #155384
Open
Sudeep-A-Kulkarni wants to merge 2 commits into
Open
gh-155140: Fix ipaddress.IPv6Address.is_link_local to require the strict fe80::/64 range#155384Sudeep-A-Kulkarni wants to merge 2 commits into
Sudeep-A-Kulkarni wants to merge 2 commits into
Conversation
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 |
This comment was marked as low quality.
This comment was marked as low quality.
picnixz
commented
Aug 8, 2026
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixesgh-155140.
Bug description:
ipaddress.IPv6Address.is_link_localcurrently checks membership in the broadfe80::/10block, but per RFC 4291 section 2.5.6 a true link-local address must have the first 64 bits equal tofe80::exactly (10-bit prefix followed by 54 zero bits). This means addresses that fall insidefe80::/10but outsidefe80::/64are incorrectly reported as link-local.Reproducer:
Current output on main:
TrueExpected output:
FalseFix:
Change
_IPv6Constants._linklocal_networkfromfe80::/10tofe80::/64, matching the strict RFC 4291 definition.Testing:
Updated the existing
testReservedIpv6assertions forfea0::andfebf:ffff::(previously expectedTrue, now correctlyFalsesince they fall outsidefe80::/64), and added regression tests forfe80::(stillTrue) and the originally reportedfe80:6666:...address (nowFalse), for bothipaddress.ip_networkandipaddress.ip_address.