summaryrefslogtreecommitdiff
path: root/module_test
diff options
context:
space:
mode:
authoryangwei <[email protected]>2023-08-15 19:49:15 +0800
committeryangwei <[email protected]>2023-08-16 10:17:28 +0800
commitfa38eb58b22542b0f8294a80c7ebd1c59aeaf531 (patch)
treeb4a93f4d05697d056a8f4298a1b6dfd25b2f382c /module_test
parent204c4e3397e565e0bd27cfeb6998b02d9a7dc378 (diff)
🧪 test(benchmark test): 修复运行时修改toml失败的错误
Diffstat (limited to 'module_test')
-rw-r--r--module_test/src/gtest_sapp_jump_layer_plug.cpp2
-rw-r--r--module_test/src/gtest_sapp_tunnel_plug.cpp10
2 files changed, 7 insertions, 5 deletions
diff --git a/module_test/src/gtest_sapp_jump_layer_plug.cpp b/module_test/src/gtest_sapp_jump_layer_plug.cpp
index b18c96a..fb23137 100644
--- a/module_test/src/gtest_sapp_jump_layer_plug.cpp
+++ b/module_test/src/gtest_sapp_jump_layer_plug.cpp
@@ -76,6 +76,8 @@ static int jump_check_ipv4_pkt(const struct ip *ip4hdr, int expect_tot_len, unsi
static int jump_check_ipv6_pkt(const struct ip6_hdr *ip6h, int expect_payload_len, unsigned char expect_protocol, const char *expect_src_addr_str, const char *expect_dst_addr_str)
{
+ if(ip6h== NULL) return -1;
+
if((*(char *)ip6h & 0xF0) != 0x60){
printf("\033[1;31;40mMESA_net_jump_to_layer(): ipv6 header check version error!\033[0m\n");
sendto_test_result(GTEST_SAPP_ERR);
diff --git a/module_test/src/gtest_sapp_tunnel_plug.cpp b/module_test/src/gtest_sapp_tunnel_plug.cpp
index 94ed5c3..738953a 100644
--- a/module_test/src/gtest_sapp_tunnel_plug.cpp
+++ b/module_test/src/gtest_sapp_tunnel_plug.cpp
@@ -570,14 +570,14 @@ extern "C" char l2tp_tunnel_stream_pfather_iterate_entry(struct streaminfo *pstr
}
pstream = pstream->pfather;
- if((NULL == pstream) || (pstream->addr.addrtype != ADDR_TYPE_IPV4)){
+ if((pstream->addr.addrtype != ADDR_TYPE_IPV4)){
printf("\033[1;31;40maddr type is not outer tuple4v4!\033[0m\n");
sendto_test_result(GTEST_SAPP_ERR);
return APP_STATE_DROPME;
}
pstream = pstream->pfather;
- if((NULL == pstream) || (pstream->addr.addrtype != ADDR_TYPE_MAC)){
+ if((pstream->addr.addrtype != ADDR_TYPE_MAC)){
printf("\033[1;31;40maddr type is not mac!\033[0m\n");
sendto_test_result(GTEST_SAPP_ERR);
return APP_STATE_DROPME;
@@ -599,21 +599,21 @@ extern "C" char pptp_tunnel_stream_pfather_iterate_entry(struct streaminfo *pstr
return APP_STATE_DROPME;
}
pstream = pstream->pfather;
- if((NULL == pstream) || (pstream->addr.addrtype != ADDR_TYPE_PPTP)){
+ if((pstream->addr.addrtype != ADDR_TYPE_PPTP)){
printf("\033[1;31;40maddr type is not pptp!\033[0m\n");
sendto_test_result(GTEST_SAPP_ERR);
return APP_STATE_DROPME;
}
pstream = pstream->pfather;
- if((NULL == pstream) || (pstream->addr.addrtype != __ADDR_TYPE_IP_PAIR_V4)){
+ if((pstream->addr.addrtype != __ADDR_TYPE_IP_PAIR_V4)){
printf("\033[1;31;40maddr type is not outer pure ipv4!\033[0m\n");
sendto_test_result(GTEST_SAPP_ERR);
return APP_STATE_DROPME;
}
pstream = pstream->pfather;
- if((NULL == pstream) || (pstream->addr.addrtype != ADDR_TYPE_MAC)){
+ if((pstream->addr.addrtype != ADDR_TYPE_MAC)){
printf("\033[1;31;40maddr type is not mac!\033[0m\n");
sendto_test_result(GTEST_SAPP_ERR);
return APP_STATE_DROPME;