mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
If a tap device is not given an explicit MAC address it will generate one randomly. The behaviour of the Linux bridge is to pickup the lowest MAC address of any port for use in for ARP, STP etc. If the tap device's randomly generated MAC address happens to be the lowest then this can cause all manner of strange networking glitches in both domain 0 and guests when the bridge suddenly takes over from the previously used MAC address. We choose FE:FF:FF:FF:FF:FF as it the numerically largest non-broadcast address. This ensures that the physical NIC device's port will have the lowest MAC address and therefore be the one picked up by the bridge. vif devices already have a MAC address of FE:FF:FF:FF:FF:FF set by netback already but there is no harm in forcing it a second time in the hotplug script. tap devices are added by the "add" event and therefore we should call setup_bridge_port then as well as for "online" which is caused by vif devices. Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Acked-by: Ian Jackson <ian.jackson@eu.citrix.com> Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>