6f1d069d14a7eef062bd5840c8217d176bdbd5a7
The id is built from up to 6 enumerated MACs. On Linux getifaddrs() also returns virtual interfaces — docker0 and the veth* pairs each container creates, tun*/wg* from a VPN, br-*/virbr* bridges. Container veths carry RANDOM MACs and appear/disappear with the containers, so the enumerated set can differ between calls: the hardware id changes and an activated licence silently stops matching its machine. Boxes running Docker (the Coder feature) would hit this routinely. This matters more on Linux than elsewhere because two of the four id components are already constant there: the system-UUID slot is a literal and GetHDDPropertyList is an empty function on non-Windows. The id rests on CPU id + MACs, so unstable MACs are most of the instability. Filter mirrors what the Windows branch already does via WMI (PNPDeviceId LIKE %PCI% — physical adapters only). The test is /sys/class/net/<name>/device, the kernel's own record of a hardware-backed interface, so it stays correct as new virtual-interface flavours appear; a name-prefix denylist is kept only for environments without /sys. MACs are bucketed during the walk and chosen after it, so a veth appearing earlier in the list cannot consume a slot and push a real NIC out. FAIL-SAFE: if no physical NIC is found, fall back to the unfiltered set. An empty list would drop all MAC entropy and — with the UUID and disk slots already constant — leave near-identical ids across different machines. Windows and macOS/BSD paths are untouched (both #else branches preserve the existing behaviour exactly). Logic verified against a simulated Docker host: enp3s0/wlp2s0 accepted; lo, docker0, veth*, br-*, tun0 rejected. ORDERING: this CHANGES the id on any Linux box that has virtual interfaces, so it must land BEFORE the first Linux licences are issued — afterwards it would invalidate them. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Description
No description provided
13 MiB
Languages
C
55.3%
C++
43.4%
Python
0.5%
CMake
0.3%
Objective-C++
0.2%
Other
0.2%