Skip to content

feat: add IPv6 address fields to welcome and pong#62

Merged
davvd merged 4 commits into
masterfrom
ipv6
Jul 4, 2026
Merged

feat: add IPv6 address fields to welcome and pong#62
davvd merged 4 commits into
masterfrom
ipv6

Conversation

@yegor256

@yegor256 yegor256 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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 of ip.
  • Welcome.home6 (bytes, 16) — the client's observed public IPv6, counterpart of home.
  • Pong.Peer.ip6 (bytes, 16) — an advertised peer's IPv6 endpoint, counterpart of ip.

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).

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.
Copilot AI review requested due to automatic review settings July 3, 2026 14:53

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ip6 to carry the client’s assigned tunnel IPv6 address.
  • Add Welcome.home6 to carry the client’s observed public IPv6 address.
  • Add Pong.Peer.ip6 to 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.

Comment thread welcome.proto
Comment on lines +40 to +44
// 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;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

yegor256 added 3 commits July 3, 2026 19:12
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.
@davvd
davvd merged commit e0d85a4 into master Jul 4, 2026
VasilevNStas added a commit to VasilevNStas/protos that referenced this pull request Jul 4, 2026
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.
@0crat

0crat commented Jul 5, 2026

Copy link
Copy Markdown

@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
@0crat

0crat commented Jul 5, 2026

Copy link
Copy Markdown

@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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants