[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] virtio-net: revert mac on reset
From: |
Laszlo Ersek |
Subject: |
Re: [Qemu-devel] [PATCH] virtio-net: revert mac on reset |
Date: |
Wed, 16 Jan 2013 14:44:50 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121116 Thunderbird/10.0.11 |
On 01/16/13 12:45, Michael S. Tsirkin wrote:
> 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 <address@hidden>
> ---
> hw/virtio-net.c | 1 +
> 1 file changed, 1 insertion(+)
>
> 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);
> }
>
Reviewed-by: Laszlo Ersek <address@hidden>