|
|
|
@ -262,14 +262,12 @@ int main(void) { |
|
|
|
struct SC_MYKEYS swap = first; first = second; second = swap; |
|
|
|
struct SC_MYKEYS swap = first; first = second; second = swap; |
|
|
|
} |
|
|
|
} |
|
|
|
struct UTUN_INSTANCE *owner = nat_fixture_node(&fixture, "127.0.0.2", NULL, |
|
|
|
struct UTUN_INSTANCE *owner = nat_fixture_node(&fixture, "127.0.0.2", NULL, |
|
|
|
"[server:second]\naddr=127.0.0.5:0\ntype=public\n" |
|
|
|
"[server:second]\naddr=127.0.0.5:0\ntype=public\n"); |
|
|
|
"[server:tcp]\naddr=127.0.0.2:0\ntype=public\ntransport=tcp\n"); |
|
|
|
|
|
|
|
struct UTUN_INSTANCE *observer = nat_fixture_node(&fixture, "127.0.0.3", NULL, NULL); |
|
|
|
struct UTUN_INSTANCE *observer = nat_fixture_node(&fixture, "127.0.0.3", NULL, NULL); |
|
|
|
struct UTUN_INSTANCE *same_ip = nat_fixture_node(&fixture, "127.0.0.3", &first, NULL); |
|
|
|
struct UTUN_INSTANCE *same_ip = nat_fixture_node(&fixture, "127.0.0.3", &first, NULL); |
|
|
|
struct UTUN_INSTANCE *helper = nat_fixture_node(&fixture, "127.0.0.4", &second, NULL); |
|
|
|
struct UTUN_INSTANCE *helper = nat_fixture_node(&fixture, "127.0.0.4", &second, NULL); |
|
|
|
struct ETCP_SOCKET *socket = test_etcp_bound_socket(owner, "udp"); |
|
|
|
struct ETCP_SOCKET *socket = test_etcp_bound_socket(owner, "udp"); |
|
|
|
struct ETCP_SOCKET *second_socket = test_etcp_bound_socket(owner, "second"); |
|
|
|
struct ETCP_SOCKET *second_socket = test_etcp_bound_socket(owner, "second"); |
|
|
|
struct ETCP_SOCKET *tcp = test_etcp_bound_socket(owner, "tcp"); |
|
|
|
|
|
|
|
struct ETCP_SOCKET *observer_socket = test_etcp_bound_socket(observer, "udp"); |
|
|
|
struct ETCP_SOCKET *observer_socket = test_etcp_bound_socket(observer, "udp"); |
|
|
|
assert(socket->sock_id != observer_socket->sock_id); |
|
|
|
assert(socket->sock_id != observer_socket->sock_id); |
|
|
|
|
|
|
|
|
|
|
|
@ -299,9 +297,6 @@ int main(void) { |
|
|
|
assert(status.round != second_status.round); |
|
|
|
assert(status.round != second_status.round); |
|
|
|
check_snapshot(owner, socket); |
|
|
|
check_snapshot(owner, socket); |
|
|
|
check_snapshot(owner, second_socket); |
|
|
|
check_snapshot(owner, second_socket); |
|
|
|
assert(tcp->address_profile.inbound == ADDRESS_IN_UNKNOWN); |
|
|
|
|
|
|
|
struct nat_check_status tcp_status; |
|
|
|
|
|
|
|
assert(!nat_detection_get_status(owner->nat_det, tcp, &tcp_status) && !tcp_status.rounds && !tcp_status.helper); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Профиль B не заимствует профиль A, даже когда транспорт переиспользуется в обе стороны. */ |
|
|
|
/* Профиль B не заимствует профиль A, даже когда транспорт переиспользуется в обе стороны. */ |
|
|
|
assert(!route_ping_addr_equal(&socket->local_addr, &observer_socket->local_addr, 1)); |
|
|
|
assert(!route_ping_addr_equal(&socket->local_addr, &observer_socket->local_addr, 1)); |
|
|
|
|