n0-computer / n0-computer/noq

refactor: Clean up ipv4-to-ipv6 address mapping in QNT code

Open
#342 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactor
Dominant language
Rust
Stars
413
Forks
63
Avg merge
2d 16h
Merged PRs (30d)
6

Description

Currently, QNT "detects" if our quinn::Endpoint::is_ipv6 is set by looking at the paths and seeing if any of them are ipv6 and uses this info to transform addresses it knows about to ipv6-mapped ipv4 addresses, if needed:

https://github.com/n0-computer/quinn/blob/1df76577f753afd86f88cd949b434d94a6255fb8/quinn-proto/src/connection/mod.rs#L6276-L6279
https://github.com/n0-computer/quinn/blob/1df76577f753afd86f88cd949b434d94a6255fb8/quinn-proto/src/connection/mod.rs#L6190-L6205

We should try to clean this up.
The quinn::Endpoint has an ipv6: bool variable, and we should make use of that and somehow get it into proto::Connection:

https://github.com/n0-computer/quinn/blob/1df76577f753afd86f88cd949b434d94a6255fb8/quinn/src/endpoint.rs#L145-L169

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read quinn/src/endpoint.rs around the ipv6 field and the referenced sections of quinn-proto/src/connection/mod.rs. Trace how Endpoint creates or initializes proto::Connection, then inspect the existing path-based address mapping. Done means Connection can use the endpoint's ipv6 value rather than inferring it from paths, with the related behavior covered by the existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
networking
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.