+Mon Oct 15 17:42:55 EDT 2001 Pekka Riikonen <priikone@silcnet.org>
+
+ * Allow backup router to announce servers. All servers
+ announced by backup router are added to the global list
+ automatically. Update hte server's socket to our primary
+ router also when backup router announces a server.
+ Affected file silcd/packet_receive.c.
+
+ * Do not update the client->router in the function
+ silc_server_udpate_clients_by_server if the client is on
+ global list. We might fail to find any specific server
+ for locally connected clients and local cell clients. They
+ should still use the `from' and not `to' as client->router.
+ This fixes backup router resuming protocol. Affected file
+ silcd/server_util.c.
+
Sun Oct 14 18:28:22 EDT 2001 Pekka Riikonen <priikone@silcnet.org>
* Assure that router cannot reroute the same channel message
router = sock->user_data;
if (server_entry->server_type == SILC_BACKUP_ROUTER &&
- id_type == SILC_ID_SERVER)
+ id_type == SILC_ID_SERVER) {
id_list = server->global_list;
+ router_sock = server->router ? server->router->connection : sock;
+ }
} else {
void *sender_id = silc_id_str2id(packet->src_id, packet->src_id_len,
packet->src_id_type);
/* If entry is disabled ignore what we got. */
if (ret != SILC_PACKET_RESUME_ROUTER &&
- idata && idata->status & SILC_IDLIST_STATUS_DISABLED)
+ idata && idata->status & SILC_IDLIST_STATUS_DISABLED) {
+ SILC_LOG_DEBUG(("Connection is disabled"));
goto out;
+ }
if (ret == SILC_PACKET_NONE)
goto out;
silc_hash_table_count(channel->user_list) < 2) {
if (channel->rekey)
silc_schedule_task_del_by_context(server->schedule, channel->rekey);
- if (!silc_idlist_del_channel(server->local_list, channel))
- silc_idlist_del_channel(server->global_list, channel);
+ if (silc_idlist_del_channel(server->local_list, channel))
server->stat.my_channels--;
+ silc_idlist_del_channel(server->global_list, channel);
continue;
}
server->router->server_name));
SILC_LOG_DEBUG(("Switching back to primary router %s",
server->router->server_name));
+ idata = (SilcIDListData)server->router;
+ idata->status &= ~SILC_IDLIST_STATUS_DISABLED;
} else {
SILC_LOG_INFO(("Resuming the use of router %s",
router->server_name));
SILC_LOG_DEBUG(("Resuming the use of router %s",
router->server_name));
+ idata = (SilcIDListData)router;
+ idata->status &= ~SILC_IDLIST_STATUS_DISABLED;
}
- idata = (SilcIDListData)server->router;
- idata->status &= ~SILC_IDLIST_STATUS_DISABLED;
-
/* Update the client entries of the backup router to the new
router */
silc_server_update_clients_by_server(server, backup_router,
silc_server_update_clients_by_real_server(server, from, client,
local, id_cache);
if (!client->router)
- client->router = to;
+ client->router = from; /* on local list put old from */
} else {
client->router = to;
}