mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
In case the host MAC address associated with a TAP device wasn't explicitly provided by the user, Cloud Hypervisor would get the host MAC associated by default with this TAP device and store it through the network config. Problem is, in the context of a snapshot/restore, that meant the network config provided by the user was different on the destination host compared to the source host. This was causing an issue when Cloud Hypervisor wasn't started with CAP_NET_ADMIN permissions as it couldn't set the host MAC address on the destination, while the source never needed these permissions since the MAC was automatically allocated by the kernel. We're fixing this issue by setting the host MAC address when it's explicitly requested by the user through the network config, and making the host MAC immutable so that it can't be changed at runtime. Signed-off-by: Sebastien Boeuf <sboeuf@meta.com>