From: Ian Campbell Date: Tue, 4 Jan 2011 15:26:02 +0000 (+0000) Subject: tools/hotplug/Linux: only apply dummy MAC address to virtual devices. X-Git-Tag: 4.1.0-rc1~94 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=386c85c23b7c64c998b911405b79f48004ca874c;p=people%2Fvhanquez%2Fxen-unstable.git tools/hotplug/Linux: only apply dummy MAC address to virtual devices. Avoid applying to the bridge and physical network device. This should un-break dom0 networking in the old xend-creates-bridge setup (problem introduced in 22493:937488219719). Signed-off-by: Ian Campbell Acked-by: Ian Jackson Signed-off-by: Ian Jackson --- diff --git a/tools/hotplug/Linux/network-bridge b/tools/hotplug/Linux/network-bridge index 035a58d8e2..6f8475acb7 100644 --- a/tools/hotplug/Linux/network-bridge +++ b/tools/hotplug/Linux/network-bridge @@ -244,7 +244,7 @@ op_start () { ip link set ${netdev} name ${pdev} ip link set ${tdev} name ${bridge} - setup_bridge_port ${pdev} + setup_physical_bridge_port ${pdev} # Restore slaves if [ -n "${slaves}" ]; then diff --git a/tools/hotplug/Linux/vif-bridge b/tools/hotplug/Linux/vif-bridge index b48e127694..1cbdd8af61 100644 --- a/tools/hotplug/Linux/vif-bridge +++ b/tools/hotplug/Linux/vif-bridge @@ -81,7 +81,7 @@ fi case "$command" in online) - setup_bridge_port "$dev" + setup_virtual_bridge_port "$dev" add_to_bridge "$bridge" "$dev" ;; @@ -91,7 +91,7 @@ case "$command" in ;; add) - setup_bridge_port "$dev" + setup_virtual_bridge_port "$dev" add_to_bridge "$bridge" "$dev" ;; esac diff --git a/tools/hotplug/Linux/vif2 b/tools/hotplug/Linux/vif2 index 247fa67acf..2c155be68c 100644 --- a/tools/hotplug/Linux/vif2 +++ b/tools/hotplug/Linux/vif2 @@ -23,7 +23,7 @@ case "$command" in "online") if [ "$bridge" != "-" ] then - setup_bridge_port "$vif" + setup_virtual_bridge_port "$vif" add_to_bridge "$bridge" "$vif" else # Just let the normal udev rules for interfaces handle it. diff --git a/tools/hotplug/Linux/xen-network-common.sh b/tools/hotplug/Linux/xen-network-common.sh index 1100757c82..8cff156d29 100644 --- a/tools/hotplug/Linux/xen-network-common.sh +++ b/tools/hotplug/Linux/xen-network-common.sh @@ -80,22 +80,32 @@ find_dhcpd_arg_file() } # configure interfaces which act as pure bridge ports: -setup_bridge_port() { +_setup_bridge_port() { local dev="$1" + local virtual="$2" # take interface down ... ip link set ${dev} down - # Initialise a dummy MAC address. We choose the numerically - # largest non-broadcast address to prevent the address getting - # stolen by an Ethernet bridge for STP purposes. - # (FE:FF:FF:FF:FF:FF) - ip link set ${dev} address fe:ff:ff:ff:ff:ff || true + if [ $virtual -ne 0 ] ; then + # Initialise a dummy MAC address. We choose the numerically + # largest non-broadcast address to prevent the address getting + # stolen by an Ethernet bridge for STP purposes. + # (FE:FF:FF:FF:FF:FF) + ip link set ${dev} address fe:ff:ff:ff:ff:ff || true + fi # ... and configure it ip addr flush ${dev} } +setup_physical_bridge_port() { + _setup_bridge_port $1 0 +} +setup_virtual_bridge_port() { + _setup_bridge_port $1 1 +} + # Usage: create_bridge bridge create_bridge () { local bridge=$1