summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHanoh Haim <hhaim@cisco.com>2016-05-03 16:08:45 +0300
committerHanoh Haim <hhaim@cisco.com>2016-05-03 16:08:45 +0300
commitdbe44f64ec7cff8d55400327e5f6994ac1fc87bb (patch)
treedff61999decaf7b8c8caa5356f31c265d3ea13e6
parent719054b1520da67ced27f1a346e27fbee88e4b34 (diff)
fix trex-204 by Wenxian with minor changes
-rw-r--r--src/main_dpdk.cpp4
-rwxr-xr-xsrc/tuple_gen.h10
2 files changed, 12 insertions, 2 deletions
diff --git a/src/main_dpdk.cpp b/src/main_dpdk.cpp
index 771c59b3..440cf820 100644
--- a/src/main_dpdk.cpp
+++ b/src/main_dpdk.cpp
@@ -1985,8 +1985,8 @@ void CCoreEthIF::update_mac_addr(CGenNode * node,uint8_t *p){
if ( unlikely( CGlobalInfo::m_options.preview.get_mac_ip_mapping_enable() ) ) {
/* mac mapping file is configured
*/
- if (if (node->is_initiator_pkt() && (node->m_src_mac.inused==INUSED)) {
- memcpy(p+6, &node->m_src_mac.mac, sizeof(uint8_t)*6);
+ if ( node->is_initiator_pkt() && (node->m_src_mac.inused==INUSED)) {
+ memcpy(p+6, &node->m_src_mac.mac, 6);
}
} else if ( unlikely( CGlobalInfo::m_options.preview.get_mac_ip_overide_enable() ) ){
/* client side */
diff --git a/src/tuple_gen.h b/src/tuple_gen.h
index d34e27bc..b2f6e34a 100755
--- a/src/tuple_gen.h
+++ b/src/tuple_gen.h
@@ -880,18 +880,28 @@ struct CTupleGenYamlInfo {
public:
bool is_valid(uint32_t num_threads,bool is_plugins);
uint8_t get_server_pool_id(std::string name){
+ if (name=="default") {
+ return 0;
+ }
for (uint8_t i=0;i<m_server_pool.size();i++) {
if (m_server_pool[i].m_name==name)
return i;
}
+ printf("ERROR invalid server pool name %s, please review your YAML file\n",(char *)name.c_str());
+ exit(-1);
return 0;
}
uint8_t get_client_pool_id(std::string name){
+ if (name=="default") {
+ return 0;
+ }
for (uint8_t i=0;i<m_client_pool.size();i++) {
if (m_client_pool[i].m_name==name)
return i;
}
+ printf("ERROR invalid client pool name %s, please review your YAML file\n",(char *)name.c_str());
+ exit(-1);
return 0;
}
};