Conversation
Add optional 16-byte ip6/home6 to Welcome and ip6 to Pong.Peer so the Node can assign clients an IPv6 tunnel address and advertise IPv6 peers. Additive and backward compatible; the existing 4-byte v4 fields are unchanged.
There was a problem hiding this comment.
Pull request overview
This PR extends the client↔Node protobuf protocol to support dual-stack addressing by introducing optional IPv6 address fields alongside the existing IPv4 fields.
Changes:
- Add
Welcome.ip6to carry the client’s assigned tunnel IPv6 address. - Add
Welcome.home6to carry the client’s observed public IPv6 address. - Add
Pong.Peer.ip6to advertise a peer’s public IPv6 endpoint.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| welcome.proto | Adds IPv6 tunnel and observed public IPv6 fields to Welcome. |
| pong.proto | Adds IPv6 endpoint advertisement to Peer entries in Pong. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // IPv6 address (16 raw bytes) assigned to the client inside the | ||
| // tunnel for the lifetime of this session, the counterpart of `ip`. | ||
| // The client uses it as the source of every encapsulated IPv6 | ||
| // packet. Empty when the Node offers no IPv6 tunnel. | ||
| bytes ip6 = 9; |
There was a problem hiding this comment.
Good catch — fixed in 700b44a. The ip comment now reads "the source address of every encapsulated IPv4 packet; IPv6 packets use ip6 instead", so it is no longer ambiguous.
The client learns its own tunnel address from Welcome, and peer IPv6 endpoints are not consumed by any client yet; they belong with the deferred v6 peer-rotation work. Keep the wire minimal until then.
The ip comment said "every encapsulated IP packet", ambiguous now that ip6 exists. Spell out IPv4 and point IPv6 at ip6.
# Conflicts: # welcome.proto
The Welcome message delivers the tunnel IP but omits the prefix length, forcing every client to hardcode the subnet out-of-band. A mismatch between implementations silently produces wrong routing tables. Add uint32 prefix = 11 carrying the CIDR prefix length (1-32). Field 9 was taken by ip6 (PR APN-Network#62). Zero means unpopulated — clients MUST treat it as malformed and disconnect. Wire-compatible addition.
|
@yegor256 Thanks for the contribution! You've earned +8 points for this: +16 as a basis; -8 for too few (15) hits-of-code. Please, keep them coming. Your running score is +18; don't forget to check your Zerocracy account too). |
1 similar comment
|
@yegor256 Thanks for the contribution! You've earned +8 points for this: +16 as a basis; -8 for too few (15) hits-of-code. Please, keep them coming. Your running score is +18; don't forget to check your Zerocracy account too). |
Adds optional IPv6 addressing to the client↔Node protocol, the first step of full dual-stack support.
Welcome.ip6(bytes, 16) — the IPv6 tunnel address the Node assigns the client, counterpart ofip.Welcome.home6(bytes, 16) — the client's observed public IPv6, counterpart ofhome.Pong.Peer.ip6(bytes, 16) — an advertised peer's IPv6 endpoint, counterpart ofip.All fields are additive and optional; the existing 4-byte IPv4 fields are unchanged, so old clients and Nodes keep interoperating. Consumed by matching PRs in node, ios, and android (each bumps its submodule gitlink to this commit).