xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: John Weekes <lists.xen@nuclearfallout.net>
To: Ian Campbell <ian.campbell@citrix.com>,
	"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address
Date: Fri, 24 Dec 2010 16:17:07 -0800	[thread overview]
Message-ID: <4D153803.8030908@nuclearfallout.net> (raw)
In-Reply-To: <ca87e5178d11a91092a5.1291741833@cosworth.uk.xensource.com>

Ian,

This appears to have the side effect on dom0 of also causing both eth0 
and peth0 to have MAC fe:ff:ff:ff:ff:ff. I had to revert it to make 
networking work properly again for me.

-John

> # HG changeset patch
> # User Ian Campbell<ian.campbell@citrix.com>
> # Date 1291741813 0
> # Node ID ca87e5178d11a91092a5c0f8e192e6dcc41d9d45
> # Parent  5e4a8db26d5addf1cb73d6d2310101e67d96c7ba
> tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address.
>
> 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>
>
> diff -r 5e4a8db26d5a -r ca87e5178d11 tools/hotplug/Linux/vif-bridge
> --- a/tools/hotplug/Linux/vif-bridge	Mon Dec 06 15:23:49 2010 +0000
> +++ b/tools/hotplug/Linux/vif-bridge	Tue Dec 07 17:10:13 2010 +0000
> @@ -91,6 +91,7 @@ case "$command" in
>           ;;
>
>       add)
> +        setup_bridge_port "$dev"
>           add_to_bridge "$bridge" "$dev"
>           ;;
>   esac
> diff -r 5e4a8db26d5a -r ca87e5178d11 tools/hotplug/Linux/xen-network-common.sh
> --- a/tools/hotplug/Linux/xen-network-common.sh	Mon Dec 06 15:23:49 2010 +0000
> +++ b/tools/hotplug/Linux/xen-network-common.sh	Tue Dec 07 17:10:13 2010 +0000
> @@ -86,6 +86,12 @@ setup_bridge_port() {
>       # 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
> +
>       # ... and configure it
>       ip addr flush ${dev}
>   }
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2010-12-25  0:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-07 17:10 [PATCH] tools/hotplug/Linux: Ensure tap devices receive a dummy MAC address Ian Campbell
2010-12-10 18:44 ` Ian Jackson
2010-12-15 10:26   ` Keir Fraser
2010-12-16 10:17     ` Ian Campbell
2010-12-25  0:17 ` John Weekes [this message]
2011-01-04  9:35   ` Ian Campbell
2011-01-04 10:53     ` Ian Campbell
2011-01-04 15:26       ` Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D153803.8030908@nuclearfallout.net \
    --to=lists.xen@nuclearfallout.net \
    --cc=ian.campbell@citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).