diff options
author | imarom <imarom@cisco.com> | 2016-11-30 13:00:54 +0200 |
---|---|---|
committer | imarom <imarom@cisco.com> | 2016-11-30 13:35:40 +0200 |
commit | 051a334b6f57280faa9dd90eeab922fb51f3c89e (patch) | |
tree | d7b1784e99edc8b71befc7f6a84d0cedb80f7667 /src/trex_port_attr.cpp | |
parent | ba3a6e1edd85873be62f17881e4a95df7daf098d (diff) |
reply to messages
Signed-off-by: imarom <imarom@cisco.com>
Diffstat (limited to 'src/trex_port_attr.cpp')
-rw-r--r-- | src/trex_port_attr.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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; } |