-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Closed
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.
Milestone
Description
Already posted this here, but I thought it was worth creating an issue so it doesn't get lost.
std.net.parseIp6 currently supports only the most basic full version of an IPv6 address. The following valid addresses are not supported:
::1::(all segments are 0)2001:db8::(last 6 segments are 0)::1234:5678(first 6 segments are 0)2001:db8::1234:5678(middle 4 segments are 0)
There is a check that when a : is encountered, if no digits have been seen then an error is returned: https://github.com/ziglang/zig/blob/master/lib/std/net.zig#L79:L81
I also don't know if it's intended to support IPv4 mapped or IPv4 compatible IPv6 addresses, but it would be nice to do so as they're quite common:
::ffff:192.0.2.128(IPv4 mapped IPv6 address)::192.0.2.128(IPv4 comaptible - though this format is deprecated)
It might also be nice to add some more helper functions related to IP addresses. For example, see the Rust documentation for std::net::IpAddr.
andrewrk
Metadata
Metadata
Assignees
Labels
contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.This issue is limited in scope and/or knowledge of Zig internals.standard libraryThis issue involves writing Zig code for the standard library.This issue involves writing Zig code for the standard library.