diff options
author | Benoît Ganne <bganne@cisco.com> | 2020-09-09 12:50:07 +0200 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2020-09-11 07:52:47 +0000 |
commit | 3f0ae664faf33578515ffa1fd5287ad692f16c6f (patch) | |
tree | 18b05164e2886020dd853b2559f13fb35eb4d8ab /src/vnet/devices/virtio/virtio_pci_modern.c | |
parent | 66bb7dd64ee2377103e18b96f1e6bf6405de44b5 (diff) |
build: fix build for Debian 9 and Debian 10
Type: fix
Change-Id: Ic07d0ae313b32e420ba93693cb75960a86f752a9
Signed-off-by: Benoît Ganne <bganne@cisco.com>
Diffstat (limited to 'src/vnet/devices/virtio/virtio_pci_modern.c')
-rw-r--r-- | src/vnet/devices/virtio/virtio_pci_modern.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/vnet/devices/virtio/virtio_pci_modern.c b/src/vnet/devices/virtio/virtio_pci_modern.c index 0d86ff2acda..4eb0ff102ae 100644 --- a/src/vnet/devices/virtio/virtio_pci_modern.c +++ b/src/vnet/devices/virtio/virtio_pci_modern.c @@ -311,19 +311,17 @@ virtio_pci_modern_del_queue (vlib_main_t * vm, virtio_if_t * vif, static void virtio_pci_modern_get_device_mac (vlib_main_t * vm, virtio_if_t * vif) { - *((u32 *) vif->mac_addr) = - virtio_pci_reg_read_u32 (vif, VIRTIO_MAC_OFFSET (vif)); - *((u16 *) (vif->mac_addr + 4)) = + vif->mac_addr32 = virtio_pci_reg_read_u32 (vif, VIRTIO_MAC_OFFSET (vif)); + vif->mac_addr16 = virtio_pci_reg_read_u16 (vif, VIRTIO_MAC_OFFSET (vif) + 4); } static void virtio_pci_modern_set_device_mac (vlib_main_t * vm, virtio_if_t * vif) { - virtio_pci_reg_write_u32 (vif, VIRTIO_MAC_OFFSET (vif), - *((u32 *) vif->mac_addr)); + virtio_pci_reg_write_u32 (vif, VIRTIO_MAC_OFFSET (vif), vif->mac_addr32); virtio_pci_reg_write_u16 (vif, VIRTIO_MAC_OFFSET (vif) + 4, - *((u16 *) (vif->mac_addr + 4))); + vif->mac_addr16); } static u16 |