summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2016-12-11 12:03:07 +0200
committerimarom <imarom@cisco.com>2016-12-11 12:03:07 +0200
commitaf9f439b2bf768f9168cecac2488b4c718ab783f (patch)
treef2e033c14a9d5d404046dd050e822a5b11156503
parent20bb36572e006147d1ee6767b46d803bdb0926df (diff)
IP src configuriation invalidates ARP resolution
Signed-off-by: imarom <imarom@cisco.com>
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py2
-rw-r--r--src/trex_port_attr.cpp4
-rwxr-xr-xsrc/trex_port_attr.h6
3 files changed, 7 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
index ebb716d1..9309ad0c 100644
--- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
+++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
@@ -959,7 +959,7 @@ class Port(object):
"src MAC": info['src_mac'],
"src IPv4": info['src_ipv4'],
"Destination": info['dest'],
- "ARP Resolution": info['arp'],
+ "ARP Resolution": format_text("{0}".format(info['arp']), 'bold', 'red') if info['arp'] == 'unresolved' else info['arp'],
"PCI Address": info['pci_addr'],
"NUMA Node": info['numa'],
"--": "",
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 */