summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/trex_port_attr.cpp4
-rwxr-xr-xsrc/trex_port_attr.h6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/trex_port_attr.cpp b/src/trex_port_attr.cpp
index 61e88585..0ecbc2c4 100644
--- a/src/trex_port_attr.cpp
+++ b/src/trex_port_attr.cpp
@@ -138,8 +138,8 @@ TRexPortAttr::to_json(Json::Value &output) {
}
void
-TRexPortAttr::update_src_dst_mac(uint8_t *raw_pkt) {
- memcpy(raw_pkt, get_dest().get_dest_mac(), 6);
+TRexPortAttr::update_src_dst_mac(uint8_t *raw_pkt) const {
+ memcpy(raw_pkt, m_dest.get_dest_mac(), 6);
memcpy(raw_pkt + 6, get_src_mac(), 6);
}
diff --git a/src/trex_port_attr.h b/src/trex_port_attr.h
index ae397430..c69314fc 100755
--- a/src/trex_port_attr.h
+++ b/src/trex_port_attr.h
@@ -73,7 +73,7 @@ public:
* if the dest is not resolved
* it will return the default MAC
*/
- const uint8_t *get_dest_mac() {
+ const uint8_t *get_dest_mac() const {
return m_mac;
}
@@ -141,7 +141,7 @@ public:
std::string get_rx_filter_mode() const;
/* for a raw packet, write the src/dst MACs */
- void update_src_dst_mac(uint8_t *raw_pkt);
+ void update_src_dst_mac(uint8_t *raw_pkt) const;
/* SETTERS */
virtual int set_promiscuous(bool enabled) = 0;
@@ -153,6 +153,8 @@ public:
void set_src_ipv4(uint32_t addr) {
m_src_ipv4 = addr;
+ /* when IP source changes - consider this as link down */
+ m_dest.on_link_down();
}
/* DUMPS */