Check real raw ICMP explicitly alongside deterministic loopback
This commit is contained in:
1 parent
83194b19c7
commit
a42dc38874
2 files changed
+15
-5
No files matched your search
+11
-1
@@ -145,6 +145,7 @@ static void test_timeout(void* arg) {
|
||||
int main(void) {
|
||||
printf("=== test_icmp_proxy ===\n");
|
||||
debug_config_init(); debug_set_level(DEBUG_LEVEL_ERROR); debug_set_categories(DEBUG_CATEGORY_ALL);
|
||||
debug_set_category_level(DEBUG_CATEGORY_GENERAL, DEBUG_LEVEL_INFO);
|
||||
utun_instance_set_tun_init_enabled(0);
|
||||
srand((unsigned)time(NULL));
|
||||
|
||||
@@ -162,7 +163,16 @@ int main(void) {
|
||||
|
||||
exit_node_id = exit_node->node_id; client_node_id = cli->node_id;
|
||||
|
||||
icmp_proxy_set_test_loopback(exit_node, 1);
|
||||
if (getenv("UTUN_TEST_ICMP_RAW")) {
|
||||
if (!exit_node->icmp_proxy || exit_node->icmp_proxy->raw_sock == SOCKET_INVALID) {
|
||||
DEBUG_ERROR(DEBUG_CATEGORY_PROXY, "ICMP raw test requires a working exit raw socket");
|
||||
goto done;
|
||||
}
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "ICMP test: real raw socket fd=%d", (int)exit_node->icmp_proxy->raw_sock);
|
||||
} else {
|
||||
icmp_proxy_set_test_loopback(exit_node, 1);
|
||||
DEBUG_INFO(DEBUG_CATEGORY_GENERAL, "ICMP test: explicit test_loopback");
|
||||
}
|
||||
|
||||
g_to_id = uasync_set_timeout(ua, 100, NULL, monitor, "mon");
|
||||
void* to_id = uasync_set_timeout(ua, TEST_TIMEOUT_MS * 10, NULL, test_timeout, "to");
|
||||
|
||||
Reference in new issue
Block a user