Skip to content

device: add priority message transmission around session establishment#80

Merged
jwhited merged 1 commit into
tailscalefrom
jwhited/tsmp-hook-handshake
Jul 15, 2026
Merged

device: add priority message transmission around session establishment#80
jwhited merged 1 commit into
tailscalefrom
jwhited/tsmp-hook-handshake

Conversation

@jwhited

@jwhited jwhited commented Jul 7, 2026

Copy link
Copy Markdown
Member

Add SetPriorityMessageOnEstablishmentFunc, which registers a
PeerPriorityMessageFunc callback invoked when a peer's session keypair
is established or re-keyed for forward data transmission. The bytes it
returns are transmitted to the peer as a transport message.

The message is "priority" in two senses: it bypasses the staged packet
queue entirely, so it cannot be evicted by TUN-sourced packets, and it
is enqueued ahead of the keepalive/staged packets that follow keypair
establishment.

Updates tailscale/tailscale#20081

@jwhited
jwhited force-pushed the jwhited/tsmp-hook-handshake branch 3 times, most recently from ca42904 to f4fb2a0 Compare July 10, 2026 04:03
@jwhited jwhited changed the title device: implement priority message transmission around session establ… device: add priority message transmission around session establishment Jul 10, 2026
@jwhited
jwhited force-pushed the jwhited/tsmp-hook-handshake branch from f4fb2a0 to d947a57 Compare July 10, 2026 23:44
@jwhited
jwhited marked this pull request as ready for review July 10, 2026 23:44
Comment thread device/device.go
Comment thread device/send.go
Comment thread device/device.go

@danderson danderson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Seems reasonable to me in isolation.

In the broader context of #20081, I wonder if wg session lifetime is the right scope for this data exchange since those sessions rotate faster than the lifetime of most things in our clients. However, assuming that is the right scope, this implementation seems reasonable to me.

Comment thread device/send.go Outdated
Add SetPriorityMessageOnEstablishmentFunc, which registers a
PeerPriorityMessageFunc callback invoked when a peer's session keypair
is established or re-keyed for forward data transmission. The bytes it
returns are transmitted to the peer as a transport message.

The message is "priority" in two senses: it bypasses the staged packet
queue entirely, so it cannot be evicted by TUN-sourced packets, and it
is enqueued ahead of the keepalive/staged packets that follow keypair
establishment.

Updates tailscale/tailscale#20081

Signed-off-by: Jordan Whited <jordan@tailscale.com>
@jwhited
jwhited force-pushed the jwhited/tsmp-hook-handshake branch from 2fd13ec to 5da8053 Compare July 15, 2026 22:19
@jwhited
jwhited merged commit 2e01ba5 into tailscale Jul 15, 2026
15 checks passed
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.

3 participants