debuggers.hg

changeset 22688:959e87a1117f

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 <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Ian Campbell <ian.campbell@citrix.com>
date Tue Jan 04 15:26:02 2011 +0000 (2011-01-04)
parents a8d69de8eb31
children 285a8f8d217e
files tools/hotplug/Linux/network-bridge tools/hotplug/Linux/vif-bridge tools/hotplug/Linux/vif2 tools/hotplug/Linux/xen-network-common.sh
line diff
     1.1 --- a/tools/hotplug/Linux/network-bridge	Tue Jan 04 11:32:20 2011 +0000
     1.2 +++ b/tools/hotplug/Linux/network-bridge	Tue Jan 04 15:26:02 2011 +0000
     1.3 @@ -244,7 +244,7 @@ op_start () {
     1.4      ip link set ${netdev} name ${pdev}
     1.5      ip link set ${tdev} name ${bridge}
     1.6  
     1.7 -    setup_bridge_port ${pdev}
     1.8 +    setup_physical_bridge_port ${pdev}
     1.9  
    1.10      # Restore slaves
    1.11      if [ -n "${slaves}" ]; then
     2.1 --- a/tools/hotplug/Linux/vif-bridge	Tue Jan 04 11:32:20 2011 +0000
     2.2 +++ b/tools/hotplug/Linux/vif-bridge	Tue Jan 04 15:26:02 2011 +0000
     2.3 @@ -81,7 +81,7 @@ fi
     2.4  
     2.5  case "$command" in
     2.6      online)
     2.7 -        setup_bridge_port "$dev"
     2.8 +        setup_virtual_bridge_port "$dev"
     2.9          add_to_bridge "$bridge" "$dev"
    2.10          ;;
    2.11  
    2.12 @@ -91,7 +91,7 @@ case "$command" in
    2.13          ;;
    2.14  
    2.15      add)
    2.16 -        setup_bridge_port "$dev"
    2.17 +        setup_virtual_bridge_port "$dev"
    2.18          add_to_bridge "$bridge" "$dev"
    2.19          ;;
    2.20  esac
     3.1 --- a/tools/hotplug/Linux/vif2	Tue Jan 04 11:32:20 2011 +0000
     3.2 +++ b/tools/hotplug/Linux/vif2	Tue Jan 04 15:26:02 2011 +0000
     3.3 @@ -23,7 +23,7 @@ case "$command" in
     3.4      "online")
     3.5  	if [ "$bridge" != "-" ]
     3.6  	    then
     3.7 -	    setup_bridge_port "$vif"
     3.8 +	    setup_virtual_bridge_port "$vif"
     3.9  	    add_to_bridge "$bridge" "$vif"
    3.10  	else
    3.11  	    # Just let the normal udev rules for interfaces handle it.
     4.1 --- a/tools/hotplug/Linux/xen-network-common.sh	Tue Jan 04 11:32:20 2011 +0000
     4.2 +++ b/tools/hotplug/Linux/xen-network-common.sh	Tue Jan 04 15:26:02 2011 +0000
     4.3 @@ -80,22 +80,32 @@ find_dhcpd_arg_file()
     4.4  }
     4.5  
     4.6  # configure interfaces which act as pure bridge ports:
     4.7 -setup_bridge_port() {
     4.8 +_setup_bridge_port() {
     4.9      local dev="$1"
    4.10 +    local virtual="$2"
    4.11  
    4.12      # take interface down ...
    4.13      ip link set ${dev} down
    4.14  
    4.15 -    # Initialise a dummy MAC address. We choose the numerically
    4.16 -    # largest non-broadcast address to prevent the address getting
    4.17 -    # stolen by an Ethernet bridge for STP purposes.
    4.18 -    # (FE:FF:FF:FF:FF:FF)
    4.19 -    ip link set ${dev} address fe:ff:ff:ff:ff:ff || true
    4.20 +    if [ $virtual -ne 0 ] ; then
    4.21 +        # Initialise a dummy MAC address. We choose the numerically
    4.22 +        # largest non-broadcast address to prevent the address getting
    4.23 +        # stolen by an Ethernet bridge for STP purposes.
    4.24 +        # (FE:FF:FF:FF:FF:FF)
    4.25 +        ip link set ${dev} address fe:ff:ff:ff:ff:ff || true
    4.26 +    fi
    4.27  
    4.28      # ... and configure it
    4.29      ip addr flush ${dev}
    4.30  }
    4.31  
    4.32 +setup_physical_bridge_port() {
    4.33 +    _setup_bridge_port $1 0
    4.34 +}
    4.35 +setup_virtual_bridge_port() {
    4.36 +    _setup_bridge_port $1 1
    4.37 +}
    4.38 +
    4.39  # Usage: create_bridge bridge
    4.40  create_bridge () {
    4.41      local bridge=$1