mirror of
https://github.com/Motorhead1991/qemu.git
synced 2026-01-10 00:17:46 -07:00
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>
This commit is contained in:
parent
7586317bc0
commit
41dc8a67c7
1 changed files with 1 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue