Conversation
SendTo is fire-and-forget: the daemon never replies, so a datagram it failed to send (no route, port policy, ephemeral ports exhausted) still returns nil. SendToConfirmed sends the daemon's new cmdSendToConfirm (0x39) and waits for cmdSendToOK (0x3A) or the daemon's error. Against a daemon that predates the command (it answers "unknown command") the datagram is sent with the legacy cmdSendTo and reported as unconfirmed; the probe is done once per Driver. SendTo is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TeoSlayer
marked this pull request as draft
October 1, 2026 15:45
Contributor
Author
|
Converted to draft after review. One bug to fix before this lands in the shared library: the IPC has no request IDs, and replies are matched by opcode only ( Everything else checked out: CI is green, and a new driver against a v1.14.1 daemon returns |
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.
Summary
Driver.SendToreturns nil as soon as the datagram is written to the daemon's socket; a datagram the daemon then fails to send (unknown node, port policy, no free ports) is only logged there. This adds a send that waits for the daemon's answer.Changes
SendToConfirmed(dst, port, data) (confirmed bool, err error)sends the newcmdSendToConfirm(0x39) and waits forcmdSendToOK(0x3A) or an error.(true, nil): the daemon handed the datagram to its tunnel (not a delivery guarantee).(false, err): the daemon could not send it, or did not answer in time.(false, nil): the daemon predates confirmed sends. It answered "unknown command", so the datagram went out with the legacy fire-and-forget command and its outcome is unknown. The driver probes once and remembers.SendTois unchanged. A confirmed send is a request/reply exchange and waits behind an in-flight dial on the sameDriver, soSendTostays the choice where throughput matters.The daemon side is pilot-protocol/pilotprotocol#494. Either can land first: an old driver against a new daemon behaves as before, and this driver falls back against an old daemon.
Test Plan
go build ./...,go vet ./...,go test ./...🤖 Generated with Claude Code