wavefnd / wavefnd/Wave

Accept IPv4 dotted-decimal tails in IPv6 address parsing

Open
#549 0 comments 0 reactions 0 assignees View on GitHub
cross-platform enhancement help wanted
Dominant language
Rust
Stars
53
Forks
16
Avg merge
4h 22m
Merged PRs (30d)
46

Description

`ipv6_parse` only accepts hexadecimal digits and colon separators. Its inner group loop passes each byte to `_ipv6_hex_value`, so the first dot rejects a mixed IPv6 address such as `::ffff:192.0.2.1`. This is an existing IPv6 text form and is useful when accepting IPv4-mapped addresses from configuration or logs.

This request extends the address parser within the current networking API; it does not add DNS resolution or change Wave language syntax.

Code evidence:

- [std/net/address.wave:196](https://github.com/wavefnd/Wave/blob/ea74c2dafc31da876e5561f2d176ba719f5a0458/std/net/address.wave#L196)
- [std/net/address.wave:189](https://github.com/wavefnd/Wave/blob/ea74c2dafc31da876e5561f2d176ba719f5a0458/std/net/address.wave#L189)

Acceptance:

- [ ] Parse a final dotted-decimal IPv4 component as the last 32 bits, with and without preceding :: compression.
- [ ] Verify ::ffff:192.0.2.1 produces the same octets as ::ffff:c000:201, and cover an uncompressed mixed form.
- [ ] Reject missing/excess octets, values above 255, a dotted component before the final position, excess total groups and repeated compression.
- [ ] Preserve hexadecimal-only parsing and formatter round trips without delegating parsing to libc.

Reference: [IPv6 text representations, RFC 4291 section 2.2](https://www.rfc-editor.org/rfc/rfc4291.html#section-2.2). Existing address examples cover hexadecimal forms, not this supported IP notation.

Audit status: static source inspection against canonical master `ea74c2dafc31da876e5561f2d176ba719f5a0458` on 2026-09-10. No compiler build, test execution, implementation change or local reproduction was performed for this report. The examples describe the source-derived behavior to verify when implementing the fix.

Contributor guide

Open the contributing guide

Research direction

Start in std/net/address.wave around ipv6_parse at lines 189 and 196, tracing the inner group loop and _ipv6_hex_value. Add coverage for compressed and uncompressed dotted-decimal tails plus the listed invalid forms, then verify hexadecimal parsing and formatter round trips still pass without libc; done means all acceptance cases are covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.