mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 12:52:04 +00:00
[PR #140] [MERGED] fix(net): stable LAN MAC from static IP so Moonlight survives Wolf recreates #140
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#140
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/140
Author: @JBailes
Created: 7/5/2026
Status: ✅ Merged
Merged: 7/5/2026
Merged by: @JBailes
Base:
main← Head:fix/stable-lan-mac-static-ip📝 Commits (1)
532caddfix(net): derive the stable LAN MAC from the static IP, not the container id📊 Changes
2 files changed (+16 additions, -6 deletions)
View changed files
📝
internal/lxc/manager.go(+13 -3)📝
internal/lxc/pve_tarball.go(+3 -3)📄 Description
Symptom
After any Wolf recreate/update, Moonlight can no longer discover or connect to Wolf on its static LAN IP until you rename the host or wait out the ARP timeout. Looks like an mDNS problem; it's actually ARP.
Cause
lanMACForContainerderived the "stable" LAN MAC viastableLANMac(id)— butidis the container ID, regenerated on every recreate. So a container with a fixedgow.lan.ip(Wolf on192.168.1.50) got a new veth MAC every recreate while reusing the IP. LAN peers/switches then hold stale ARP for that IP → the host is unreachable until the cache ages out. (stableLANMac's own doc comment calls out the Moonlight/Wolf case — the intent was right, the key was wrong.)Fix
Key the MAC on the requested static LAN IP when present (
lanip:<ip>), so the same IP always maps to the same MAC across recreates. With no static IP the address itself changes per recreate, so the id-derived MAC is unchanged.Live-verified (pve .253, RTX 5080)
Wolf's MAC changed across recreates (
02:f1:34:49:ec:9f→02:74:68:68:f2:46), which is what silently broke Moonlight discovery through this whole debugging session. After the fix the MAC is derived from192.168.1.50and holds across recreates.go test ./internal/lxc/passes.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.