diff options
author | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-08-05 14:07:32 +1000 |
---|---|---|
committer | Stephen Rothwell <sfr@canb.auug.org.au> | 2008-08-05 14:07:32 +1000 |
commit | 6d6c4a9162a85ad021c97b1001b046b996a79e95 (patch) | |
tree | 14b66c77a78d8fc734c71e4168422a0c694019b1 /Documentation | |
parent | 0fed4ea63b19cda86bff4b86d6fa25134e1a4c72 (diff) | |
parent | b7574fbc265fdb87458c43fbafb3a05a095337df (diff) |
Merge branch 'quilt/rr'
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/lguest/lguest.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Documentation/lguest/lguest.c b/Documentation/lguest/lguest.c index b88b0ea54e90..8369d3d4391d 100644 --- a/Documentation/lguest/lguest.c +++ b/Documentation/lguest/lguest.c @@ -1501,7 +1501,7 @@ static void setup_tun_net(char *arg) struct device *dev; int netfd, ipfd; u32 ip = INADDR_ANY; - bool bridging = false; + bool bridging = false, set_mac; char tapif[IFNAMSIZ], *p; struct virtio_net_config conf; @@ -1530,12 +1530,17 @@ static void setup_tun_net(char *arg) /* A mac address may follow the bridge name or IP address */ p = strchr(arg, ':'); if (p) { + set_mac = true; str2mac(p+1, conf.mac); *p = '\0'; } else { p = arg + strlen(arg); /* None supplied; query the randomly assigned mac. */ get_mac(ipfd, tapif, conf.mac); + + /* If we're bridging we want a different MAC than the tun + * interface. */ + set_mac = !bridging; } /* arg is now either an IP address or a bridge name */ @@ -1547,13 +1552,14 @@ static void setup_tun_net(char *arg) /* Set up the tun device. */ configure_device(ipfd, tapif, ip); - /* Tell Guest what MAC address to use. */ - add_feature(dev, VIRTIO_NET_F_MAC); + /* Tell Guest what MAC address to use unless we're bridging and the + * command line didn't tell us to. */ + if (set_mac) + add_feature(dev, VIRTIO_NET_F_MAC); add_feature(dev, VIRTIO_F_NOTIFY_ON_EMPTY); /* Expect Guest to handle everything except UFO */ add_feature(dev, VIRTIO_NET_F_CSUM); add_feature(dev, VIRTIO_NET_F_GUEST_CSUM); - add_feature(dev, VIRTIO_NET_F_MAC); add_feature(dev, VIRTIO_NET_F_GUEST_TSO4); add_feature(dev, VIRTIO_NET_F_GUEST_TSO6); add_feature(dev, VIRTIO_NET_F_GUEST_ECN); |