November 4, 2025
When JSON met IPv6
SocketAddrV6 is not roundtrip serializable
Rust devs hit a weird JSON bug, and IPv6 took the blame
TLDR: Oxide found that an IPv6 socket address didn’t survive a JSON roundtrip, revealing a subtle mismatch. The comments exploded into a battle: one side demands “IPv4 but bigger,” the other praises IPv6 features like scope IDs. Why it matters: saved data that changes on reload can break systems.
Oxide engineers ran a test to make sure a complex report could be turned into JSON (a plain text format) and back again without changing. The serialize step passed, but the roundtrip failed when an IPv6 socket address came back different. Translation for normal humans: an internet address didn’t survive the “save and reload” test, and devs panicked. Cue the comment-section fireworks.
The loudest voices slammed IPv6’s complexity. One top-voted snark: “Another day, another reason IPv6 should have been IPv4 with more bits.” Others posted the classic “falsehoods programmers believe about addresses,” warning that parsing is messier than anyone wants to admit—like the cursed ::1%3 scope trick. Meanwhile, networking veterans jumped in to defend IPv6, saying the scope ID (think: which network path to use) solves real problems and is way cleaner than the weird rituals needed in older IPv4 APIs.
Memes flew: jokes about JSON “ghosting” your interface info, port 0 being “a mood,” and devs trying to roundtrip a hydra. It’s a perfect tech drama—part code bug, part internet plumbing, all vibes. If you thought addresses were just numbers, the thread made sure you’ll never look at ::ffff:0.0.0.0 the same way again. Check the proptest docs if you dare.
Key Points
- •JSON only supports string or numeric map keys; a Rust data structure with complex map keys caused serialization panic via serde.
- •Oxide used property-based testing with proptest and Arbitrary to generate and shrink random instances for robust testing.
- •A serialization-only property test for the PlanningReport type passed, confirming no panic on JSON serialization.
- •A JSON roundtrip test (serialize then deserialize and assert equality) failed on a minimal input containing an IPv6-mapped address string.
- •The article’s title indicates SocketAddrV6 is not roundtrip serializable, explaining the equality failure after JSON roundtrip.