Skip to content

net: scope host TAP/netns families under net_scope "cm" - #25

Merged
CMGS merged 3 commits into
masterfrom
chore/cocoon-net-scope
Aug 17, 2026
Merged

net: scope host TAP/netns families under net_scope "cm"#25
CMGS merged 3 commits into
masterfrom
chore/cocoon-net-scope

Conversation

@CMGS

@CMGS CMGS commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Why

cocoon's GC and cleanup identify bridge TAPs and CNI netns by host-wide name family (bt<vmid8>-<nic>, cocoon-<vmid>). Sharing that family meant a co-hosted cocoon daemon could reclaim a live macOS guest's TAP as an orphan (and vice versa). cocoon master now keys the families per installation via net_scope (cocoonstack/cocoon#196).

What

  • Bump github.com/cocoonstack/cocoon to master (cde2318) and go mod tidy.
  • cmd/vm/net_linux.go: one netConf(cmd) builder for the cocoon network config with NetScope = "cm", shared by provider construction and rm teardown; bridge.CleanupTAPs takes the scoped prefix.
  • Auto-created devices are now cm<vmid8>-<nic> / cm-<vmid>. No dual-prefix transition: devices created by earlier builds are not cleaned up by this one.
  • scripts/e2e.sh: cleanup + leak checks follow the cm family (the old bt[0-9a-f] pattern never matched the base32 VM IDs, so the leak check was vacuous).
  • docs/networking.md: document the family.
  • review: commit joins every wrapped multi-line // comment to one line (no content change).

Verification

  • go build ./... / GOOS=linux go build ./..., go vet both GOOS, go test ./... green
  • make lint (golangci-lint, linux + darwin): 0 issues
  • asl ./... both GOOS: clean
  • bash -n scripts/e2e.sh

CMGS added 3 commits August 17, 2026 18:16
Bump cocoon to master (net_scope): bridge.CleanupTAPs now takes the TAP
prefix, and config.Config carries NetScope. cocoon-macos builds its
network config once (netConf) with NetScope "cm", so its auto-created
TAPs (cm<vmid8>-<nic>) and CNI netns (cm-<vmid>) are a separate name
family from a co-hosted cocoon's — neither side's GC or cleanup can
reclaim the other's live guests.

e2e.sh cleanup/leak checks follow the new family (and match the base32
VM IDs the old hex pattern never did). No dual-prefix transition.
@CMGS
CMGS merged commit 1d966bc into master Aug 17, 2026
3 checks passed
@CMGS
CMGS deleted the chore/cocoon-net-scope branch August 17, 2026 10:32
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.

1 participant