Commit cdd34829 authored by Pavel Yazev's avatar Pavel Yazev Committed by Viktor Oreshkin

Fixed uninitialized PID.ip failure (fix #6) (#57)

parent 842f343d
...@@ -243,7 +243,9 @@ static int tcp_rpcc_send_handshake_packet (connection_job_t C) /* {{{ */ { ...@@ -243,7 +243,9 @@ static int tcp_rpcc_send_handshake_packet (connection_job_t C) /* {{{ */ {
struct tcp_rpc_data *D = TCP_RPC_DATA (C); struct tcp_rpc_data *D = TCP_RPC_DATA (C);
struct tcp_rpc_handshake_packet P; struct tcp_rpc_handshake_packet P;
assert (PID.ip); if (!PID.pid) {
init_client_PID (c->our_ip);
}
memset (&P, 0, sizeof (P)); memset (&P, 0, sizeof (P));
P.type = RPC_HANDSHAKE; P.type = RPC_HANDSHAKE;
P.flags = tcp_get_default_rpc_flags () & RPCF_USE_CRC32C; P.flags = tcp_get_default_rpc_flags () & RPCF_USE_CRC32C;
......
...@@ -237,7 +237,9 @@ static int tcp_rpcs_process_nonce_packet (connection_job_t C, struct raw_message ...@@ -237,7 +237,9 @@ static int tcp_rpcs_process_nonce_packet (connection_job_t C, struct raw_message
static int tcp_rpcs_send_handshake_packet (connection_job_t c) { static int tcp_rpcs_send_handshake_packet (connection_job_t c) {
struct tcp_rpc_data *D = TCP_RPC_DATA(c); struct tcp_rpc_data *D = TCP_RPC_DATA(c);
struct tcp_rpc_handshake_packet P; struct tcp_rpc_handshake_packet P;
assert (PID.pid); if (!PID.ip) {
PID.ip = get_my_ipv4 ();
}
memset (&P, 0, sizeof (P)); memset (&P, 0, sizeof (P));
P.type = RPC_HANDSHAKE; P.type = RPC_HANDSHAKE;
P.flags = D->crypto_flags & RPCF_USE_CRC32C; P.flags = D->crypto_flags & RPCF_USE_CRC32C;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment