updates.
authorPekka Riikonen <priikone@silcnet.org>
Mon, 15 Oct 2001 14:46:12 +0000 (14:46 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Mon, 15 Oct 2001 14:46:12 +0000 (14:46 +0000)
CHANGES
apps/silcd/packet_receive.c
apps/silcd/server.c
apps/silcd/server_backup.c
apps/silcd/server_util.c

diff --git a/CHANGES b/CHANGES
index a655b2a72a9446f1673c1bb543b1a194fee0f46d..0b381330e14da63beaeb4a9f2fd724916d3cfcf4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,19 @@
+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
index 06dc814c4cd38744302ebb1fec3c7981dfc91b93..0717c8ca0f6cff1ff1b729e848cf0481969d5e25 100644 (file)
@@ -1806,8 +1806,10 @@ static void silc_server_new_id_real(SilcServer server,
     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);
index ae8592c432d80ec1ce3d28b4631b54256ef37363..a9395e399db27012da1c771ea50dd1b3624c017f 100644 (file)
@@ -1628,8 +1628,10 @@ SILC_TASK_CALLBACK(silc_server_packet_parse_real)
 
   /* 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;
@@ -2485,9 +2487,9 @@ void silc_server_remove_from_channels(SilcServer server,
        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;
     }
 
index d040d454b65d0efd5828689502a334ffe7a582da..31cd6efddb1ee0d404f84e18b5470ab410874eba 100644 (file)
@@ -1091,16 +1091,17 @@ SILC_TASK_CALLBACK_GLOBAL(silc_server_protocol_backup)
                         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,
index 26c33fc6db6a616d6fb9aa15392ade6f0c738423..30c9e157eebaebd1015ec5847fb24b8d2b825213 100644 (file)
@@ -469,7 +469,7 @@ void silc_server_update_clients_by_server(SilcServer server,
              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;
          }