From 051a334b6f57280faa9dd90eeab922fb51f3c89e Mon Sep 17 00:00:00 2001 From: imarom Date: Wed, 30 Nov 2016 13:00:54 +0200 Subject: reply to messages Signed-off-by: imarom --- src/trex_port_attr.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/trex_port_attr.cpp') diff --git a/src/trex_port_attr.cpp b/src/trex_port_attr.cpp index b215a245..53ae19d8 100644 --- a/src/trex_port_attr.cpp +++ b/src/trex_port_attr.cpp @@ -48,7 +48,9 @@ DestAttr::set_dest(uint32_t ipv4, const uint8_t *mac) { assert(ipv4 != 0); m_ipv4 = ipv4; - memcpy(m_mac, mac, 6); + + /* source might be the same as dest (this shadows the datapath memory) */ + memmove(m_mac, mac, 6); m_type = DEST_TYPE_IPV4; } @@ -60,7 +62,9 @@ void DestAttr::set_dest(const uint8_t *mac) { m_ipv4 = 0; - memcpy(m_mac, mac, 6); + + /* source might be the same as dest (this shadows the datapath memory) */ + memmove(m_mac, mac, 6); m_type = DEST_TYPE_MAC; } -- cgit 1.2.3-korg