canonical / canonical/multipass
Implement Platform Specific ARP Table Lookups
- Dominant language
- C++
- Stars
- 9.2k
- Forks
- 828
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 44
Description
**What are you trying to do?**
Prevent MAC address collisions by checking the host ARP/neighbor table before assigning a generated MAC address.
**What's your proposed solution?**
Extend `generate_unused_mac_address` to:
* Check the internal `VMSpecs` database (existing behavior)
* Query the host OS neighbor table (ARP cache)
* Regenerate the MAC if a conflict is found
Platform-specific approach:
* **macOS:** Use `sysctl` with `NET_RT_FLAGS` and `RTF_LLINFO` to inspect ARP entries
* **Windows:** Use `GetIpNetTable2` from `IPHLPAPI.lib` to query the neighbor cache
**Additional context**
As of now, MAC validation is limited to Multipass-managed instances.
This can likely cause collisions with external devices on the same LAN.
Contributor guide
Research direction
Start by locating generate_unused_mac_address and reviewing its existing VMSpecs database check. Then investigate the proposed macOS sysctl and Windows GetIpNetTable2 neighbor-table entry points. Done means generated MAC addresses are checked against host neighbor data and regenerated on conflicts, while preserving the existing validation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, macos
- Domain
- networking, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100