mirror of
https://github.com/slackhq/nebula.git
synced 2026-08-15 10:36:57 +02:00
linux: let the kernel resolve the tun.dev %d template atomically
Resolving the template in userspace (LinkList then TUNSETIFF) races with concurrent instances: both can pick nebula0, and with multiqueue the loser silently attaches as a second queue to the winner's device instead of failing. TUNSETIFF natively substitutes a single %d via dev_alloc_name, atomically and always allocating a fresh device, so keep the fail-fast validation but pass the template through and read the resolved name back. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fg7oD3uZ4jZjjQ4gRsPAwB
This commit is contained in:
+1
-1
@@ -245,7 +245,7 @@ tun:
|
||||
# For Linux: a single `%d` anywhere in the name is treated as a template and replaced with the
|
||||
# lowest number that yields an unused device name (e.g. `nebula%d` becomes `nebula0`, then `nebula1`, and so on, `neb%dprod` becomes `neb0prod`).
|
||||
# Only on Linux: `nebula%d` is the default if tun.dev is unset.
|
||||
# The resulting name must be shorter than the kernel limit of 16 characters.
|
||||
# The name, both before and after %d substitution, must be shorter than the kernel limit of 16 characters.
|
||||
# For macOS: if set, must be in the form `utun[0-9]+`.
|
||||
# For NetBSD: Required to be set, must be in the form `tun[0-9]+`
|
||||
dev: nebula1
|
||||
|
||||
Reference in New Issue
Block a user