diff options
author | Michael S. Tsirkin <mst@redhat.com> | 2013-01-16 11:37:40 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2013-01-30 01:31:08 +0200 |
commit | 41dc8a67c7dcecdf7ae1cd25db3c46f2b42a221f (patch) | |
tree | af81e510943a4785b21508b1532a565240438cbd /hw | |
parent | 7586317bc0db3b993446b21eec914f5b66645ee4 (diff) | |
download | hqemu-41dc8a67c7dcecdf7ae1cd25db3c46f2b42a221f.zip hqemu-41dc8a67c7dcecdf7ae1cd25db3c46f2b42a221f.tar.gz |
virtio-net: revert mac on reset
Once guest overrides virtio net primary mac,
it retains the value set until qemu exit.
This is inconsistent with standard nic behaviour.
To fix, revert the mac to the original value on reset.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/virtio-net.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/hw/virtio-net.c b/hw/virtio-net.c index 3bb01b1..4d80a25 100644 --- a/hw/virtio-net.c +++ b/hw/virtio-net.c @@ -199,6 +199,7 @@ static void virtio_net_reset(VirtIODevice *vdev) n->mac_table.multi_overflow = 0; n->mac_table.uni_overflow = 0; memset(n->mac_table.macs, 0, MAC_TABLE_ENTRIES * ETH_ALEN); + memcpy(&n->mac[0], &n->nic->conf->macaddr, sizeof(n->mac)); memset(n->vlans, 0, MAX_VLAN >> 3); } |