server->id_entry->router = NULL;
server->router = NULL;
server->standalone = TRUE;
+ server->backup_primary = FALSE;
backup_router = NULL;
} else {
if (server->id_entry != backup_router) {
if (protocol->state == SILC_PROTOCOL_STATE_ERROR ||
protocol->state == SILC_PROTOCOL_STATE_FAILURE) {
/* Error occured during protocol */
- SILC_LOG_ERROR(("Error occurred during rekey protocol"));
+ SILC_LOG_ERROR(("Error occurred during rekey protocol with
+ %s (%s)", sock->hostname, sock->ip));
silc_protocol_cancel(protocol, server->schedule);
silc_protocol_free(protocol);
sock->protocol = NULL;
idata = (SilcIDListData)server_entry;
SILC_LOG_DEBUG(("Sending CONNECTED packet (session %d)", ctx->session));
+ SILC_LOG_INFO(("Sending CONNECTED (session %d) to backup router",
+ ctx->session));
/* Send the CONNECTED packet back to the backup router. */
buffer = silc_buffer_alloc(2);
to be back online. We send the CONNECTED packet after we've
established the connection to the primary router. */
primary = silc_server_config_get_primary_router(server);
- if (primary && server->backup_primary) {
+ if (primary && server->backup_primary &&
+ !silc_server_num_sockets_by_remote(server,
+ silc_net_is_ip(primary->host) ?
+ primary->host : NULL,
+ silc_net_is_ip(primary->host) ?
+ NULL : primary->host,
+ primary->port,
+ SILC_SOCKET_TYPE_ROUTER)) {
SILC_LOG_DEBUG(("Received START (session %d), reconnect to router",
ctx->session));
silc_server_backup_reconnect(server,
/* Nowhere to connect just return the CONNECTED packet */
SILC_LOG_DEBUG(("Received START (session %d), send CONNECTED back",
ctx->session));
+ SILC_LOG_INFO(("Sending CONNECTED (session %d) to backup router",
+ ctx->session));
/* Send the CONNECTED packet back to the backup router. */
packet = silc_buffer_alloc(2);
SILC_LOG_INFO(("Resuming the use of primary router %s",
router->server_name));
}
+ server->backup_primary = FALSE;
/* Update the client entries of the backup router to the new
router */