summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main_dpdk.cpp15
-rw-r--r--src/pre_test.cpp10
2 files changed, 19 insertions, 6 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index af6d8366..2aab7f5d 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -3308,11 +3308,20 @@ void CGlobalTRex::pre_test() {
// we don't have dest MAC. Get it from what we resolved.
uint32_t ip = CGlobalInfo::m_options.m_ip_cfg[port_id].get_def_gw();
uint16_t vlan = CGlobalInfo::m_options.m_ip_cfg[port_id].get_vlan();
- if (! pretest.get_mac(port_id, ip, vlan, mac)) {
+
+ if (!pretest.get_mac(port_id, ip, vlan, mac)) {
fprintf(stderr, "Failed resolving dest MAC for default gateway:%d.%d.%d.%d on port %d\n"
, (ip >> 24) & 0xFF, (ip >> 16) & 0xFF, (ip >> 8) & 0xFF, ip & 0xFF, port_id);
- exit(1);
+
+ if (get_is_stateless()) {
+ continue;
+ } else {
+ exit(1);
+ }
}
+
+
+
memcpy(CGlobalInfo::m_options.m_mac_addr[port_id].u.m_mac.dest, mac, ETHER_ADDR_LEN);
// if port is connected in loopback, no need to send gratuitous ARP. It will only confuse our ingress counters.
if (need_grat_arp[port_id] && (! pretest.is_loopback(port_id))) {
@@ -3341,7 +3350,7 @@ void CGlobalTRex::pre_test() {
m_ports[port_id].get_port_attr()->get_dest().set_dest_mac(dst_mac);
}
-
+ }
}
}
diff --git a/src/pre_test.cpp b/src/pre_test.cpp
index 583427eb..42d1bc67 100644
--- a/src/pre_test.cpp
+++ b/src/pre_test.cpp
@@ -137,9 +137,13 @@ bool CPretestOnePortInfo::get_mac(COneIPInfo *ip, uint8_t *mac) {
default:
assert(0);
}
-
- (*it)->get_mac(mac);
- return true;
+
+ if ((*it)->resolve_needed()) {
+ return false;
+ } else {
+ (*it)->get_mac(mac);
+ return true;
+ }
}
return false;