This fixes the problem of SKE remaining running in the background
even though the conncection is closed because it was never aborted
because the connection wasn't marked local. After SKE timeout a
crash may occur.
if (server->router_conn && server->router_conn->sock == stream &&
!server->router && server->standalone) {
if (server->router_conn && server->router_conn->sock == stream &&
!server->router && server->standalone) {
- if (idata->sconn->callback)
+ if (idata->sconn && idata->sconn->callback)
(*idata->sconn->callback)(server, NULL, idata->sconn->callback_context);
silc_server_create_connections(server);
silc_server_free_sock_user_data(server, stream, NULL);
(*idata->sconn->callback)(server, NULL, idata->sconn->callback_context);
silc_server_create_connections(server);
silc_server_free_sock_user_data(server, stream, NULL);
server->backup_closed = TRUE;
}
server->backup_closed = TRUE;
}
- if (idata->sconn->callback)
+ if (idata->sconn && idata->sconn->callback)
(*idata->sconn->callback)(server, NULL, idata->sconn->callback_context);
silc_server_free_sock_user_data(server, stream, NULL);
}
(*idata->sconn->callback)(server, NULL, idata->sconn->callback_context);
silc_server_free_sock_user_data(server, stream, NULL);
}
server->backup_closed = TRUE;
}
server->backup_closed = TRUE;
}
- if (idata->sconn->callback)
+ if (idata->sconn && idata->sconn->callback)
(*idata->sconn->callback)(server, NULL, idata->sconn->callback_context);
silc_server_free_sock_user_data(server, stream, NULL);
}
(*idata->sconn->callback)(server, NULL, idata->sconn->callback_context);
silc_server_free_sock_user_data(server, stream, NULL);
}
{
SilcPacketStream sock = context;
SilcUnknownEntry entry = silc_packet_get_context(sock);
{
SilcPacketStream sock = context;
SilcUnknownEntry entry = silc_packet_get_context(sock);
- SilcServerConnection sconn = entry->data.sconn;
- SilcServer server = entry->server;
- SilcServerConfigRouter *conn = sconn->conn.ref_ptr;
+ SilcServerConnection sconn;
+ SilcServer server;
+ SilcServerConfigRouter *conn;
SilcAuthMethod auth_meth = SILC_AUTH_NONE;
void *auth_data = NULL;
SilcUInt32 auth_data_len = 0;
SilcAuthMethod auth_meth = SILC_AUTH_NONE;
void *auth_data = NULL;
SilcUInt32 auth_data_len = 0;
SilcHmac hmac_send, hmac_receive;
SilcHash hash;
SilcHmac hmac_send, hmac_receive;
SilcHash hash;
- SILC_LOG_DEBUG(("Connection %p, SKE completed, entry %p", sconn, entry));
-
+ server = entry->server;
+ sconn = entry->data.sconn;
+ conn = sconn->conn.ref_ptr;
+ SILC_LOG_DEBUG(("Connection %p, SKE completed, entry %p", sconn, entry));
+
if (status != SILC_SKE_STATUS_OK) {
/* SKE failed */
SILC_LOG_ERROR(("Error (%s) during Key Exchange protocol with %s (%s)",
if (status != SILC_SKE_STATUS_OK) {
/* SKE failed */
SILC_LOG_ERROR(("Error (%s) during Key Exchange protocol with %s (%s)",
entry->port = port;
entry->server = server;
entry->data.conn_type = SILC_CONN_UNKNOWN;
entry->port = port;
entry->server = server;
entry->data.conn_type = SILC_CONN_UNKNOWN;
+ entry->data.status |= SILC_IDLIST_STATUS_LOCAL;
silc_packet_set_context(packet_stream, entry);
SILC_LOG_DEBUG(("Created unknown connection %p", entry));
silc_packet_set_context(packet_stream, entry);
SILC_LOG_DEBUG(("Created unknown connection %p", entry));