net/tap: fix memcpy with incorrect size
authorPavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Fri, 6 Apr 2018 11:30:31 +0000 (17:00 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 13 Apr 2018 22:40:21 +0000 (00:40 +0200)
commit28aa16db4ae64c48f4341fc9b6d05922d7e62c84
tree69d150a46241e0aa7d9977cf72282ae95680ce7b
parenta922c6a789ffa335c1aff5aa0340a479abf0c371
net/tap: fix memcpy with incorrect size

Fix incorrect sizeof operation being used for getting mac addr size.

Found while compiling with arm64 clang.
drivers/net/tap/rte_eth_tap.c:1410:40: error: argument to 'sizeof' in
    'memcpy' call is the same pointer type 'struct ether_addr *' as the
    destination; expected 'struct ether_addr' or an explicit length
    [-Werror,-Wsizeof-pointer-memaccess]
       rte_memcpy(&pmd->eth_addr, mac_addr, sizeof(mac_addr));
                  ~~~~~~~~~~~~~~            ^~~~~~~~~~~~~~~~

Fixes: bcab6c1d27fa ("net/tap: allow user MAC to be passed as args")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@caviumnetworks.com>
Acked-by: Zhiyong Yang <zhiyong.yang@intel.com>
drivers/net/tap/rte_eth_tap.c