Skip to content

Fix warm fork guest MAC reconfiguration#245

Merged
sjmiller609 merged 4 commits into
mainfrom
codex/fix-warm-fork-guest-mac
May 27, 2026
Merged

Fix warm fork guest MAC reconfiguration#245
sjmiller609 merged 4 commits into
mainfrom
codex/fix-warm-fork-guest-mac

Conversation

@sjmiller609
Copy link
Copy Markdown
Collaborator

@sjmiller609 sjmiller609 commented May 27, 2026

Summary

  • apply the allocated MAC during post-restore guest network reconfiguration
  • verify eth0 reports the expected MAC before restore readiness succeeds
  • cover the generated reconfiguration command in unit tests

Testing

  • go test ./lib/instances -run 'Test(GuestNetworkReconfigureCommand|NetworkConfigFromAllocation|RequiresRestoreConfigDiskRefresh)'\n- go test ./lib/instances ./lib/hypervisor/firecracker

Note

Medium Risk
Changes standby-restore guest networking and MAC allocation; misconfiguration could break fork connectivity or cause MAC clashes, but scope is narrow and covered by new unit tests.

Overview
Warm standby fork restores now rebuild guest eth0 identity to match the new allocation, not only the snapshotted IP/route.

Post-resume guest network setup is centralized in guestNetworkReconfigureCommand, which validates IP/MAC/gateway/netmask, brings eth0 down, sets the allocated MAC, flushes old IPv4 addresses, reapplies the fork IP and default route, brings the link up, and flushes neighbor cache. CreateAllocation now picks MACs unused across existing allocations (random retries, then sequential scan in the 02:00:00:… space), with unit tests for collision handling and the generated shell command.

Reviewed by Cursor Bugbot for commit c4aba89. Bugbot is set up for automated code reviews on this repo. Configure here.

@sjmiller609 sjmiller609 marked this pull request as ready for review May 27, 2026 17:04
@firetiger-agent
Copy link
Copy Markdown

Firetiger deploy monitoring skipped

This PR didn't match the auto-monitor filter configured on your GitHub connection:

Any PR that changes the kernel API. Monitor changes to API endpoints (packages/api/cmd/api/) and Temporal workflows (packages/api/lib/temporal) in the kernel repo

Reason: PR modifies guest MAC reconfiguration logic in instances/hypervisor packages, not the API endpoints or Temporal workflows specified in the filter.

To monitor this PR anyway, reply with @firetiger monitor this.

Comment thread lib/network/allocate.go
@sjmiller609 sjmiller609 requested a review from rgarcia May 27, 2026 17:18
@sjmiller609 sjmiller609 merged commit 44a6da4 into main May 27, 2026
11 checks passed
@sjmiller609 sjmiller609 deleted the codex/fix-warm-fork-guest-mac branch May 27, 2026 17:24
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.

2 participants