Repository navigation
Accept all RFC 6874 unreserved characters in IPv6 zone IDs - #217
Merged
Merged
Conversation
The zone ID pattern only allowed letters and digits, so addresses with common interface names were rejected: fe80::1%eth0.100 (a VLAN interface), fe80::1%br-lan (a bridge) or fe80::1%en_0. RFC 6874 defines ZoneID = 1*( unreserved / pct-encoded ), and unreserved also includes "-", ".", "_" and "~". The pattern now accepts those as well.
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 free
to 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.
The zone ID pattern only allows letters and digits, so link-local addresses on common interfaces are rejected:
RFC 6874 (section 2) defines
ZoneID = 1*( unreserved / pct-encoded ), andunreservedisALPHA / DIGIT / "-" / "." / "_" / "~". Python'sipaddressaccepts them too (ipaddress.IPv6Address('fe80::1%br-lan')).The
zoneIndexpattern is now%[0-9a-z._~-]{1,}. It is shared by the native and transitional IPv6 patterns and by the zone extraction inexpandIPv6, soparse,isValid,parseCIDRand IPv4-mapped addresses with a zone all accept the new characters. A zone ID still can't be empty or contain spaces,%or/.The new test
accepts zone IDs with the other RFC 6874 unreserved characterscovers.,-,_and~, an IPv4-mapped address,parseCIDR, and two invalid zone IDs. It fails without the change.npm test(71 tests) andnpm run lintpass.