Cannot parse IPv6 link-local adresses from the TOML file #596
Labels
No Label
AdminAPI
Bug
Check AWS
CI
Correctness
Critical
Documentation
Ideas
Improvement
Low priority
Newcomer
Performance
S3 Compatibility
Testing
Usability
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Deuxfleurs/garage#596
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
0/
It seems like the TOML parser is struggling parsing (what I think is) a valid IPv6 link-local address:
I tried to investigate this a bit further by creating a minimal Serde reproduction. I get the same behavior:
Is this really a Serde bug? Or am I doing something very wrong here?
I looked at the serde bug tracker, I couldn't find anybody complaining about this. It'd be really surprising to be the first one stumbling upon a bug on this pretty common IPv6 addr, I feel like I'm missing something obvious here :/
It seems like Serde currently does not parse the IPv6 scope identifier:
03da66c805/serde/src/de/impls.rs (L1621)
, the last parameter ofnet::SocketAddrV6::new
https://doc.rust-lang.org/stable/std/net/struct.SocketAddrV6.html#method.new.I'm really surprised.
This is definitely not a garage-specific bug though. I'll upstream the bug report to Serde.
Last update:
The Rust parser only supports int scope ids: https://doc.rust-lang.org/stable/src/core/net/parser.rs.html#236. (Serde is re-using this parser)
So, basically, instead of using
fe80::1%wg-garage
, I should be usingfe80::1%9
. You can figure out the scope id associated to an interface via:Having a look at the relevant RFC, I learned that:
It seems like the Rust team MAY have decided not to implement the interface-as-a-zone_id notation. That's unfortunate, it's a really handy notation.
I thought this zone-id notation was a valid IPv6 textual representation. But it seems like the specification is pretty loose and the decision up to the implementer. TIL
In any case, I think it's safe to assume this issue is definitely out of scope as far as garage goes. Let's put an end to this monologue and close it.