mirror of
https://github.com/slackhq/nebula.git
synced 2026-11-17 09:56:52 +01:00
darwin: pipeline listenIn's sends so write batches can form
On darwin, listenIn encrypts into one SendBatch while a sender goroutine writes the other (batch.SendPipeline). The sender takes whatever built up during its last write, so writes overlap tun reads and packets queued behind a write leave in one WriteBatch, which a connected socket sends as one sendmsg_x. Two batches bound memory; a full producer waits for the swap rather than dropping. One producer and one sender keep per-peer order equal to message-counter order. Everywhere else the branch is a false constant and listenIn is unchanged. -tags send_pipeline builds the pipeline on any platform, so its tests and the e2e suite can run through it on linux. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
81f991f1fd
commit
64bec56404
6 files changed
+726
No files matched your search
@@ -0,0 +1,13 @@
|
||||
//go:build !darwin && !send_pipeline
|
||||
|
||||
package nebula
|
||||
|
||||
import "github.com/slackhq/nebula/overlay/tio"
|
||||
|
||||
// sendPipelinePlatform is false off darwin: the pipelined send path (interface_pipeline.go) is darwin only for now,
|
||||
// and listenIn writes its own batches everywhere else. Being a constant, it removes the branch at compile time.
|
||||
// Build with -tags send_pipeline to run the pipeline, and its tests, on another platform.
|
||||
const sendPipelinePlatform = false
|
||||
|
||||
// listenInPipelined is a plain function rather than a method so this unreachable stub leaves no trace in the binary.
|
||||
func listenInPipelined(*Interface, tio.Queue, int) {}
|
||||
Reference in new issue
Block a user