New upstream version 16.11.4
[deb_dpdk.git] / drivers / net / vmxnet3 / vmxnet3_ethdev.c
index aedac6c..2bd2f27 100644 (file)
@@ -441,10 +441,10 @@ vmxnet3_write_mac(struct vmxnet3_hw *hw, const uint8_t *addr)
                     addr[0], addr[1], addr[2],
                     addr[3], addr[4], addr[5]);
 
-       val = *(const uint32_t *)addr;
+       memcpy(&val, addr, 4);
        VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACL, val);
 
-       val = (addr[5] << 8) | addr[4];
+       memcpy(&val, addr + 4, 2);
        VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_MACH, val);
 }
 
@@ -762,6 +762,8 @@ vmxnet3_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)
 {
        struct vmxnet3_hw *hw = dev->data->dev_private;
 
+       ether_addr_copy(mac_addr, (struct ether_addr *)(hw->perm_addr));
+       ether_addr_copy(mac_addr, &dev->data->mac_addrs[0]);
        vmxnet3_write_mac(hw, mac_addr->addr_bytes);
 }