|
|
|
|
@ -1072,12 +1072,12 @@ void etcp_link_enter_ready_tcp(struct ETCP_LINK *link) {
|
|
|
|
|
if (link->tcp_link) { |
|
|
|
|
uint8_t peer_gop = stcp_link_get_peer_got_initial_pkt(link->tcp_link); |
|
|
|
|
uint64_t peer_rid = stcp_link_get_peer_reset_id(link->tcp_link); |
|
|
|
|
if (etcp->got_initial_pkt == 1 && peer_gop == 0 && peer_rid != etcp->reset_id) { |
|
|
|
|
if (etcp->got_initial_pkt == 1 && peer_gop == 0) { |
|
|
|
|
DEBUG_INFO(DEBUG_CATEGORY_ETCP, "[%s] TCP ready: I'm dirty (gop=1) but peer clean (gop=0) → reinit", |
|
|
|
|
etcp->log_name); |
|
|
|
|
etcp_conn_reinit(etcp, "tcp peer clean"); |
|
|
|
|
} |
|
|
|
|
etcp_conn_apply_peer_reset_id(etcp, etcp->peer_node_id, peer_rid); |
|
|
|
|
etcp_conn_apply_peer_reset_id(etcp, peer_rid); |
|
|
|
|
|
|
|
|
|
link->peer_device_type = stcp_link_get_peer_device_type(link->tcp_link); |
|
|
|
|
{ uint16_t peer_ka = stcp_link_get_peer_keepalive_interval(link->tcp_link); |
|
|
|
|
@ -1753,7 +1753,7 @@ static int handle_init_response_client(struct ETCP_SOCKET* e_sock, struct ETCP_D
|
|
|
|
|
uint64_t server_node_id = be64toh(*(uint64_t*)resp->node_id); |
|
|
|
|
uint64_t resp_reset_id = be64toh(*(uint64_t*)resp->reset_id); |
|
|
|
|
DEBUG_TRACE(DEBUG_CATEGORY_CONNECTION, "INIT_RESPONSE rid=%016llx", (unsigned long long)resp_reset_id); |
|
|
|
|
etcp_conn_apply_peer_reset_id(link->etcp, server_node_id, resp_reset_id); |
|
|
|
|
etcp_conn_apply_peer_reset_id(link->etcp, resp_reset_id); |
|
|
|
|
link->mtu_remote = be16toh(*(uint16_t*)resp->mtu); |
|
|
|
|
if (link->mtu_remote > PACKET_DATA_MAX_MTU) link->mtu_remote = PACKET_DATA_MAX_MTU; |
|
|
|
|
link->mtu = link->mtu_local < link->mtu_remote ? link->mtu_local : link->mtu_remote; |
|
|
|
|
@ -2280,7 +2280,7 @@ create_new_link:
|
|
|
|
|
memcpy(conn->peer_ed25519_pubkey, req->ed25519_pubkey, SC_PUBKEY_SIZE); |
|
|
|
|
|
|
|
|
|
// Применяем эпоху ресета пира ПОСЛЕ всей reinit-логики
|
|
|
|
|
etcp_conn_apply_peer_reset_id(conn, peer_id, reset_id); |
|
|
|
|
etcp_conn_apply_peer_reset_id(conn, reset_id); |
|
|
|
|
|
|
|
|
|
send_init_response(e_sock, pkt, link, conn, req, &addr, send_reset, req_src_ip, req_src_port, pkt_len); |
|
|
|
|
return; |
|
|
|
|
|