feat(welcome): add prefix field for CIDR subnet mask#47
Open
VasilevNStas wants to merge 1 commit into
Open
Conversation
Contributor
Author
Member
|
@VasilevNStas we have merge conflicts here, please resolve them and we'll merge |
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.
VasilevNStas
force-pushed
the
15-feat/welcome-prefix
branch
from
July 4, 2026 17:58
701904f to
5426629
Compare
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds a
prefixfield to theWelcomemessage carrying the CIDR subnet mask for the tunnel IP, enabling correct TUN interface configuration without hardcoded assumptions.Problem
Welcome.ip(field 2) delivers the tunnel address as 4 raw bytes but omits the prefix length. Configuring a TUN interface requires both the address and the network boundary (e.g.ip addr add 10.0.0.5/24 dev tun0). Without this field every implementation hardcodes the subnet out-of-band; a mismatch silently produces wrong routing tables.Fix
New field
uint32 prefix = 9:The
ipcomment is also updated to cross-referenceprefix.Migration
Nodes must populate
prefixalongsideipon every successful Auth. Clients that receive prefix == 0 should treat the Welcome as malformed and disconnect.Closes #15