Introduce UnicastLinkLocal IP address types - #84
Merged
Conversation
taspelund
requested review from
ahl,
internet-diglett,
jgallagher,
nicolaskagami and
zeeshanlakhani
August 11, 2026 19:36
ahl
reviewed
Aug 11, 2026
jgallagher
reviewed
Aug 11, 2026
jgallagher
left a comment
There was a problem hiding this comment.
Took a quick first look - just leaving a few high-ish level observations
|
|
||
| schemars::schema::SchemaObject { | ||
| subschemas: Some(Box::new(schemars::schema::SubschemaValidation { | ||
| one_of: Some(vec![ |
There was a problem hiding this comment.
I don't know JsonSchema well enough to review manual impls. Is the wire format for all of these essentially strings (but restricted via regex to unicast IPs)?
Contributor
Author
There was a problem hiding this comment.
Yep, exactly. The regex restricts it to the unicast link-local ranges (multicast link-local ranges are separate)
ahl
requested changes
Aug 11, 2026
Adds UnicastLinkLocal types that wrap IpAddr, Ipv4Addr and Ipv6Addr. These guarantee at time of construction that the wrapped IP is both unicast and link-local in scope. Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
impl Deref for ipv{4,6} types, yank extra constructors, cleanup parse
error chain, serialize and deserialize through std ip types.
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
taspelund
force-pushed
the
trey/unicast-link-local-ip
branch
from
August 12, 2026 01:14
b9acc98 to
cecfacf
Compare
jgallagher
approved these changes
Aug 12, 2026
jgallagher
left a comment
There was a problem hiding this comment.
+1 to Nicolas's rustdoc nits, but all the changes LGTM. Thanks!
Signed-off-by: Trey Aspelund <trey@oxidecomputer.com>
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.
Adds UnicastLinkLocal types that wrap IpAddr, Ipv4Addr and Ipv6Addr. These guarantee at time of construction that the wrapped IP is both unicast and link-local in scope.