WHOIS command works on router environment.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 15 Dec 2000 15:05:38 +0000 (15:05 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 15 Dec 2000 15:05:38 +0000 (15:05 +0000)
Register remote router automatically when connecting to it.
Rewrote IDENTIFY command.
IDList find routines returns the ID Cache Entry now.

12 files changed:
CHANGES
apps/silc/testi.conf
apps/silc/testi2.conf
apps/silcd/command.c
apps/silcd/command.h
apps/silcd/command_reply.c
apps/silcd/idlist.c
apps/silcd/idlist.h
apps/silcd/packet_receive.c
apps/silcd/packet_receive.h
apps/silcd/server.c
apps/silcd/testi2.conf

diff --git a/CHANGES b/CHANGES
index a0696db738e8fe1486c4abcc8fe8f4056b60e7d5..dcfec65692c94b05c89390b1a772f8c1abdd52e2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,39 @@
+Fri Dec 15 15:55:12 EET 2000  Pekka Riikonen <priikone@poseidon.pspt.fi>
+
+       * Changed char *data to unsigned char *data in ID Cache system to
+         support binary data as ID Cache data. Changed code to support
+         binary data in lib/silccore/idcache.c.
+
+       * Renamed silc_server_packet_relay_command_reply to 
+         silc_server_command_reply as it is normal packet receiving
+         function. Rewrote the function to accept command replys for
+         servers and not only for clients.
+
+       * Mark remote router always as registered server if we are connecting
+         to it.  Otherwise, commands sent by the router to us are ignored.
+
+       * All ID List find routines now returns the ID Cache Entry pointer
+         as well if requested.
+
+       * WHOIS command works now in router environment, tested with two
+         routers, two servers and two clients.
+
+       * Cleaned up and rewrote IDENTIFY command. IDENTIFY should work now
+         in router environment (as it is almost equivalent to WHOIS) but
+         hasn't been tested thoroughly.  Added new functions:
+
+         silc_server_command_identify_parse
+         silc_server_command_identify_send_reply
+         silc_server_command_identify_from_client
+         silc_server_command_identify_from_server
+
+       * Disabled route cache adding because adding two different ID's with
+         same IP replaces the old cache entry thus giving wrong route.
+         The entry->router->connection is always the fastest route anyway
+         so route cache may not be needed.  Of course, new routes maybe
+         established after receiving the ID when the entry->router->connection
+         might not be anymore the most optimal.
+
 Thu Dec 14 15:55:35 EET 2000  Pekka Riikonen <priikone@poseidon.pspt.fi>
 
        * Add route cache for received ID for fast routing.
index a8a8768ffda5cc4b6ae97403a87780428e044d54..168f63bb92007ff9216dce1fc6fb43f1a8bc1cfe 100644 (file)
@@ -1,8 +1,8 @@
 [cipher]
-twofish:/home/priikone/silc/lib/silcsim/modules/twofish.sim.so:16:16
-rc6:/home/priikone/silc/lib/silcsim/modules/rc6.sim.so:16:16
-mars:/home/priikone/silc/lib/silcsim/modules/mars.sim.so:16:16
-none:/home/priikone/silc/lib/silcsim/modules/none.sim.so:0:0
+twofish:/home/silc/silc/lib/silcsim/modules/twofish.sim.so:16:16
+rc6:/home/silc/silc/lib/silcsim/modules/rc6.sim.so:16:16
+mars:/home/silc/silc/lib/silcsim/modules/mars.sim.so:16:16
+none:/home/silc/silc/lib/silcsim/modules/none.sim.so:0:0
 
 [hash]
 md5::64:16
index e1fa600f60334d78c51e66e4bbc466c1b29336cf..64f3839f1ef6705a11802410e314f8f158a77c6a 100644 (file)
@@ -1,8 +1,8 @@
 [cipher]
-twofish:/home/priikone/silc/lib/silcsim/modules/twofish.sim.so:16:16
-rc6:/home/priikone/silc/lib/silcsim/modules/rc6.sim.so:16:16
-mars:/home/priikone/silc/lib/silcsim/modules/mars.sim.so:16:16
-none:/home/priikone/silc/lib/silcsim/modules/none.sim.so:0:0
+twofish:/home/silc/silc/lib/silcsim/modules/twofish.sim.so:16:16
+rc6:/home/silc/silc/lib/silcsim/modules/rc6.sim.so:16:16
+mars:/home/silc/silc/lib/silcsim/modules/mars.sim.so:16:16
+none:/home/silc/silc/lib/silcsim/modules/none.sim.so:0:0
 
 [hash]
 md5::64:16
@@ -17,5 +17,5 @@ sha1::64:20
 
 [commands]
 #/server lassi:1333
-/server lassi:1334
+#/server lassi:1334
 #/server leevi:1333
index 7bc6d692d9a11ee15c78927bbee3f756bdf059a4..b8c2030b9c07ec3c786d0a43906207aafd182c8b 100644 (file)
@@ -1890,13 +1890,26 @@ SILC_SERVER_CMD_FUNC(join)
 {
   SilcServerCommandContext cmd = (SilcServerCommandContext)context;
   SilcServer server = cmd->server;
-  int tmp_len;
+  int argc, tmp_len;
   char *tmp, *channel_name = NULL, *cipher = NULL;
   SilcChannelEntry channel;
   unsigned int umode = 0;
   int created = FALSE;
 
-  SILC_SERVER_COMMAND_CHECK_ARGC(SILC_COMMAND_JOIN, cmd, 1, 3);
+  SILC_LOG_DEBUG(("Start"));
+
+  /* Check number of parameters */
+  argc = silc_argument_get_arg_num(cmd->args);
+  if (argc < 1) {
+    silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN,
+                                         SILC_STATUS_ERR_NOT_ENOUGH_PARAMS);
+    goto out;
+  }
+  if (argc > 3) {
+    silc_server_command_send_status_reply(cmd, SILC_COMMAND_JOIN,
+                                         SILC_STATUS_ERR_TOO_MANY_PARAMS);
+    goto out;
+  }
 
   /* Get channel name */
   tmp = silc_argument_get_arg_type(cmd->args, 1, &tmp_len);
index e5fdc06ec901f6a538b2956ed235eae5e827de8d..72ada8b30df493d80b10ea52d317a6a0496b8962 100644 (file)
@@ -56,7 +56,7 @@ typedef struct {
   SilcCommandPayload payload;
   SilcArgumentPayload args;
   SilcPacketContext *packet;
-  int pending;
+  int pending;                 /* Command is being re-processed when TRUE */
 } *SilcServerCommandContext;
 
 /* Structure holding pending commands. If command is pending it will be
index 74ba0d6dbb6e1658a011464ad821c4f9aa2f032a..ff9556d1233e7eb607755a4c0430e0e35625df93 100644 (file)
@@ -49,7 +49,7 @@ do {                                                                    \
 SilcServerCommandReply silc_command_reply_list[] =
 {
   SILC_SERVER_CMD_REPLY(join, JOIN),
-  SILC_SERVER_CMD_REPLY(identify, WHOIS),
+  SILC_SERVER_CMD_REPLY(whois, WHOIS),
   SILC_SERVER_CMD_REPLY(identify, IDENTIFY),
 
   { NULL, 0 },
@@ -115,10 +115,8 @@ void silc_server_command_reply_free(SilcServerCommandReplyContext cmd)
 }
 
 /* Caches the received WHOIS information. If we are normal server currently
-   we cache global information only for short period of time.  If we are
-   router we want to cache them a bit longer since we can receive information
-   if any of the information becomes invalid. Normal server cannot receive
-   that information. Returns FALSE if something was wrong with the reply. */
+   we cache global information only for short period of time.  */
+/* XXX cache expirying not implemented yet! */
 
 static char
 silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd)
@@ -129,6 +127,9 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd)
   char *nickname, *username, *realname;
   SilcClientID *client_id;
   SilcClientEntry client;
+  SilcIDCacheEntry cache = NULL;
+  char global = FALSE;
+  char *nick;
 
   id_data = silc_argument_get_arg_type(cmd->args, 2, &id_len);
   nickname = silc_argument_get_arg_type(cmd->args, 3, &len);
@@ -141,29 +142,68 @@ silc_server_command_reply_whois_save(SilcServerCommandReplyContext cmd)
 
   /* Check if we have this client cached already. */
 
-  client = silc_idlist_find_client_by_id(server->local_list, client_id);
-  if (!client && server->server_type == SILC_ROUTER)
-    client = silc_idlist_find_client_by_id(server->global_list, client_id);
+  client = silc_idlist_find_client_by_id(server->local_list, client_id,
+                                        &cache);
+  if (!client) {
+    client = silc_idlist_find_client_by_id(server->global_list, 
+                                          client_id, &cache);
+    global = TRUE;
+  }
 
   if (!client) {
+    /* If router did not find such Client ID in its lists then this must
+       be bogus client or some router in the net is buggy. */
+    if (server->server_type == SILC_ROUTER)
+      return FALSE;
+
+    /* Take hostname out of nick string if it includes it. */
+    if (strchr(nickname, '@')) {
+      int len = strcspn(nickname, "@");
+      nick = silc_calloc(len + 1, sizeof(char));
+      memcpy(nick, nickname, len);
+    } else {
+      nick = strdup(nickname);
+    }
+
     /* We don't have that client anywhere, add it. The client is added
-       to global list since server or router didn't have it in the lists
-       so it must be global. */
-    silc_idlist_add_client(server->global_list, strdup(nickname),
-                          username, realname, client_id, NULL, NULL);
+       to global list since server didn't have it in the lists so it must be 
+       global. */
+    silc_idlist_add_client(server->global_list, nick,
+                          strdup(username), 
+                          strdup(realname), client_id, NULL, NULL);
   } else {
     /* We have the client already, update the data */
 
+    SILC_LOG_DEBUG(("Updating client data"));
+
+    /* Take hostname out of nick string if it includes it. */
+    if (strchr(nickname, '@')) {
+      int len = strcspn(nickname, "@");
+      nick = silc_calloc(len + 1, sizeof(char));
+      memcpy(nick, nickname, len);
+    } else {
+      nick = strdup(nickname);
+    }
+
+    if (client->nickname)
+      silc_free(client->nickname);
     if (client->username)
       silc_free(client->username);
     if (client->userinfo)
       silc_free(client->userinfo);
     
+    client->nickname = nick;
     client->username = strdup(username);
     client->userinfo = strdup(realname);
-  }
 
-  silc_free(client_id);
+    if (cache) {
+      cache->data = nick;
+      silc_idcache_sort_by_data(global ? server->global_list->clients : 
+                               server->local_list->clients);
+    }
+
+    silc_free(client_id);
+  }
 
   return TRUE;
 }
@@ -212,6 +252,100 @@ SILC_SERVER_CMD_REPLY_FUNC(whois)
   silc_server_command_reply_free(cmd);
 }
 
+/* Caches the received IDENTIFY information. */
+
+static char
+silc_server_command_reply_identify_save(SilcServerCommandReplyContext cmd)
+{
+  SilcServer server = cmd->server;
+  int len, id_len;
+  unsigned char *id_data;
+  char *nickname, *username;
+  SilcClientID *client_id;
+  SilcClientEntry client;
+  SilcIDCacheEntry cache = NULL;
+  char global = FALSE;
+  char *nick = NULL;
+
+  id_data = silc_argument_get_arg_type(cmd->args, 2, &id_len);
+  nickname = silc_argument_get_arg_type(cmd->args, 3, &len);
+  username = silc_argument_get_arg_type(cmd->args, 4, &len);
+  if (!id_data)
+    return FALSE;
+
+  client_id = silc_id_payload_parse_id(id_data, id_len);
+
+  /* Check if we have this client cached already. */
+
+  client = silc_idlist_find_client_by_id(server->local_list, client_id,
+                                        &cache);
+  if (!client) {
+    client = silc_idlist_find_client_by_id(server->global_list, 
+                                          client_id, &cache);
+    global = TRUE;
+  }
+
+  if (!client) {
+    /* If router did not find such Client ID in its lists then this must
+       be bogus client or some router in the net is buggy. */
+    if (server->server_type == SILC_ROUTER)
+      return FALSE;
+
+    /* Take hostname out of nick string if it includes it. */
+    if (nickname) {
+      if (strchr(nickname, '@')) {
+       int len = strcspn(nickname, "@");
+       nick = silc_calloc(len + 1, sizeof(char));
+       memcpy(nick, nickname, len);
+      } else {
+       nick = strdup(nickname);
+      }
+    }
+
+    /* We don't have that client anywhere, add it. The client is added
+       to global list since server didn't have it in the lists so it must be 
+       global. */
+    silc_idlist_add_client(server->global_list, nick,
+                          username ? strdup(username) : NULL, NULL,
+                          client_id, NULL, NULL);
+  } else {
+    /* We have the client already, update the data */
+
+    SILC_LOG_DEBUG(("Updating client data"));
+
+    /* Take hostname out of nick string if it includes it. */
+    if (nickname) {
+      if (strchr(nickname, '@')) {
+       int len = strcspn(nickname, "@");
+       nick = silc_calloc(len + 1, sizeof(char));
+       memcpy(nick, nickname, len);
+      } else {
+       nick = strdup(nickname);
+      }
+    }
+
+    if (nickname && client->nickname) {
+      silc_free(client->nickname);
+      client->nickname = nick;
+    }
+
+    if (username && client->username) {
+      silc_free(client->username);
+      client->username = strdup(username);
+    }
+
+    if (nickname && cache) {
+      cache->data = nick;
+      silc_idcache_sort_by_data(global ? server->global_list->clients : 
+                               server->local_list->clients);
+    }
+
+    silc_free(client_id);
+  }
+
+  return TRUE;
+}
+
 /* Received reply for forwarded IDENTIFY command. We have received the
    requested identify information now and we will cache it. After this we
    will call the pending command so that the requestee gets the information
@@ -220,33 +354,19 @@ SILC_SERVER_CMD_REPLY_FUNC(whois)
 SILC_SERVER_CMD_REPLY_FUNC(identify)
 {
   SilcServerCommandReplyContext cmd = (SilcServerCommandReplyContext)context;
-  SilcServer server = cmd->server;
   SilcCommandStatus status;
 
   SILC_LOG_DEBUG(("Start"));
 
   COMMAND_CHECK_STATUS_LIST;
 
-  /* Process one identify reply */
+  if (!silc_server_command_reply_identify_save(cmd))
+    goto out;
+
+  /* XXX */
+
   if (status == SILC_STATUS_OK) {
-    SilcClientID *client_id;
-    unsigned int len;
-    unsigned char *id_data;
-    char *nickname, *username;
-
-    id_data = silc_argument_get_arg_type(cmd->args, 2, &len);
-    nickname = silc_argument_get_arg_type(cmd->args, 3, NULL);
-    if (!id_data || !nickname)
-      goto out;
-
-    username = silc_argument_get_arg_type(cmd->args, 4, NULL);
-    client_id = silc_id_payload_parse_id(id_data, len);
-
-    /* Add the client always to our global list. If normal or router server
-       ever gets here it means they don't have this client's information
-       in their cache. */
-    silc_idlist_add_client(server->global_list, strdup(nickname),
-                          username, NULL, client_id, NULL, NULL);
+
   }
 
   if (status == SILC_STATUS_LIST_START) {
index 0b770081d0b05168998712424f11253305783ac0..ba06733d5272a145ce8128a49ed408ce6ecda1fd 100644 (file)
@@ -107,7 +107,8 @@ silc_idlist_add_server(SilcIDList id_list,
 /* Finds server by Server ID */
 
 SilcServerEntry
-silc_idlist_find_server_by_id(SilcIDList id_list, SilcServerID *id)
+silc_idlist_find_server_by_id(SilcIDList id_list, SilcServerID *id,
+                             SilcIDCacheEntry *ret_entry)
 {
   SilcIDCacheEntry id_cache = NULL;
   SilcServerEntry server;
@@ -123,6 +124,9 @@ silc_idlist_find_server_by_id(SilcIDList id_list, SilcServerID *id)
 
   server = (SilcServerEntry)id_cache->context;
 
+  if (ret_entry)
+    *ret_entry = id_cache;
+
   return server;
 }
 
@@ -245,11 +249,47 @@ silc_idlist_get_clients_by_nickname(SilcIDList id_list, char *nickname,
   return clients;
 }
 
+/* Returns all clients matching requested nickname. Number of clients is
+   returned to `clients_count'. Caller must free the returned table. */
+
+SilcClientEntry *
+silc_idlist_get_clients_by_hash(SilcIDList id_list, char *nickname,
+                               SilcHash md5hash,
+                               unsigned int *clients_count)
+{
+  SilcIDCacheList list = NULL;
+  SilcIDCacheEntry id_cache = NULL;
+  SilcClientEntry *clients;
+  unsigned char hash[32];
+  int i;
+
+  silc_hash_make(md5hash, nickname, strlen(nickname), hash);
+
+  if (!silc_idcache_find_by_data(id_list->clients, hash, &list))
+    return NULL;
+
+  clients = silc_calloc(silc_idcache_list_count(list), sizeof(*clients));
+
+  i = 0;
+  silc_idcache_list_first(list, &id_cache);
+  clients[i++] = (SilcClientEntry)id_cache->context;
+
+  while (silc_idcache_list_next(list, &id_cache))
+    clients[i++] = (SilcClientEntry)id_cache->context;
+  
+  silc_idcache_list_free(list);
+  
+  if (clients_count)
+    *clients_count = i;
+
+  return clients;
+}
+
 /* Finds client entry by nickname. */
 
 SilcClientEntry
 silc_idlist_find_client_by_nickname(SilcIDList id_list, char *nickname,
-                                   char *server)
+                                   char *server, SilcIDCacheEntry *ret_entry)
 {
   SilcIDCacheList list = NULL;
   SilcIDCacheEntry id_cache = NULL;
@@ -281,6 +321,9 @@ silc_idlist_find_client_by_nickname(SilcIDList id_list, char *nickname,
       return NULL;
 
     client = (SilcClientEntry)id_cache->context;
+
+    if (ret_entry)
+      *ret_entry = id_cache;
   }
 
   return client;
@@ -290,7 +333,7 @@ silc_idlist_find_client_by_nickname(SilcIDList id_list, char *nickname,
 
 SilcClientEntry
 silc_idlist_find_client_by_hash(SilcIDList id_list, char *nickname,
-                               SilcHash md5hash)
+                               SilcHash md5hash, SilcIDCacheEntry *ret_entry)
 {
   SilcIDCacheList list = NULL;
   SilcIDCacheEntry id_cache = NULL;
@@ -325,13 +368,17 @@ silc_idlist_find_client_by_hash(SilcIDList id_list, char *nickname,
   
   silc_idcache_list_free(list);
 
+  if (ret_entry)
+    *ret_entry = id_cache;
+
   return client;
 }
 
 /* Finds client by Client ID */
 
 SilcClientEntry
-silc_idlist_find_client_by_id(SilcIDList id_list, SilcClientID *id)
+silc_idlist_find_client_by_id(SilcIDList id_list, SilcClientID *id,
+                             SilcIDCacheEntry *ret_entry)
 {
   SilcIDCacheEntry id_cache = NULL;
   SilcClientEntry client;
@@ -347,6 +394,9 @@ silc_idlist_find_client_by_id(SilcIDList id_list, SilcClientID *id)
 
   client = (SilcClientEntry)id_cache->context;
 
+  if (ret_entry)
+    *ret_entry = id_cache;
+
   return client;
 }
 
@@ -373,6 +423,16 @@ silc_idlist_replace_client_id(SilcIDList id_list, SilcClientID *old_id,
   client->id = new_id;
   id_cache->id = (void *)new_id;
 
+  /* If the old ID Cache data was the hash value of the old Client ID
+     replace it with the hash of new Client ID */
+  if (id_cache->data && !SILC_ID_COMPARE_HASH(old_id, id_cache->data)) {
+    silc_free(id_cache->data);
+    id_cache->data = silc_calloc(sizeof(new_id->hash), 
+                                sizeof(unsigned char));
+    memcpy(id_cache->data, new_id->hash, sizeof(new_id->hash));
+    silc_idcache_sort_by_data(id_list->clients);
+  }
+
   return client;
 }
 
@@ -451,7 +511,8 @@ void silc_idlist_del_channel(SilcIDList id_list, SilcChannelEntry entry)
    are not case-sensitive. */
 
 SilcChannelEntry
-silc_idlist_find_channel_by_name(SilcIDList id_list, char *name)
+silc_idlist_find_channel_by_name(SilcIDList id_list, char *name,
+                                SilcIDCacheEntry *ret_entry)
 {
   SilcIDCacheList list = NULL;
   SilcIDCacheEntry id_cache = NULL;
@@ -469,6 +530,9 @@ silc_idlist_find_channel_by_name(SilcIDList id_list, char *name)
 
   channel = (SilcChannelEntry)id_cache->context;
 
+  if (ret_entry)
+    *ret_entry = id_cache;
+
   silc_idcache_list_free(list);
 
   return channel;
@@ -477,7 +541,8 @@ silc_idlist_find_channel_by_name(SilcIDList id_list, char *name)
 /* Finds channel by Channel ID. */
 
 SilcChannelEntry
-silc_idlist_find_channel_by_id(SilcIDList id_list, SilcChannelID *id)
+silc_idlist_find_channel_by_id(SilcIDList id_list, SilcChannelID *id,
+                              SilcIDCacheEntry *ret_entry)
 {
   SilcIDCacheEntry id_cache = NULL;
   SilcChannelEntry channel;
@@ -493,5 +558,8 @@ silc_idlist_find_channel_by_id(SilcIDList id_list, SilcChannelID *id)
 
   channel = (SilcChannelEntry)id_cache->context;
 
+  if (ret_entry)
+    *ret_entry = id_cache;
+
   return channel;
 }
index 9ac13a59ee7a8d0d3465091bb66edc56393dd739..28ad0a3e6efd56c058de8202b91a6f5cfd9b246c 100644 (file)
@@ -461,7 +461,8 @@ silc_idlist_add_server(SilcIDList id_list,
                       SilcServerID *id, SilcServerEntry router,
                       void *connection);
 SilcServerEntry
-silc_idlist_find_server_by_id(SilcIDList id_list, SilcServerID *id);
+silc_idlist_find_server_by_id(SilcIDList id_list, SilcServerID *id,
+                             SilcIDCacheEntry *ret_entry);
 SilcServerEntry
 silc_idlist_replace_server_id(SilcIDList id_list, SilcServerID *old_id,
                              SilcServerID *new_id);
@@ -473,14 +474,20 @@ void silc_idlist_del_client(SilcIDList id_list, SilcClientEntry entry);
 SilcClientEntry *
 silc_idlist_get_clients_by_nickname(SilcIDList id_list, char *nickname,
                                    char *server, unsigned int *clients_count);
+SilcClientEntry *
+silc_idlist_get_clients_by_hash(SilcIDList id_list, char *nickname,
+                               SilcHash md5hash,
+                               unsigned int *clients_count);
 SilcClientEntry
 silc_idlist_find_client_by_nickname(SilcIDList id_list, char *nickname,
-                                   char *server);
+                                   char *server,
+                                   SilcIDCacheEntry *ret_entry);
 SilcClientEntry
 silc_idlist_find_client_by_hash(SilcIDList id_list, char *nickname,
-                               SilcHash md5hash);
+                               SilcHash md5hash, SilcIDCacheEntry *ret_entry);
 SilcClientEntry
-silc_idlist_find_client_by_id(SilcIDList id_list, SilcClientID *id);
+silc_idlist_find_client_by_id(SilcIDList id_list, SilcClientID *id,
+                             SilcIDCacheEntry *ret_entry);
 SilcClientEntry
 silc_idlist_replace_client_id(SilcIDList id_list, SilcClientID *old_id,
                              SilcClientID *new_id);
@@ -490,8 +497,10 @@ silc_idlist_add_channel(SilcIDList id_list, char *channel_name, int mode,
                        SilcCipher channel_key);
 void silc_idlist_del_channel(SilcIDList id_list, SilcChannelEntry entry);
 SilcChannelEntry
-silc_idlist_find_channel_by_name(SilcIDList id_list, char *name);
+silc_idlist_find_channel_by_name(SilcIDList id_list, char *name,
+                                SilcIDCacheEntry *ret_entry);
 SilcChannelEntry
-silc_idlist_find_channel_by_id(SilcIDList id_list, SilcChannelID *id);
+silc_idlist_find_channel_by_id(SilcIDList id_list, SilcChannelID *id,
+                              SilcIDCacheEntry *ret_entry);
 
 #endif
index a89124f370f63d5c14ff84ee70a9463f847cf184..a83350395f8dec0c0c85e0e40b0a3c9848b2b427 100644 (file)
@@ -125,9 +125,11 @@ void silc_server_private_message(SilcServer server,
                         "No such nickname: Private message not sent");
 }
 
-/* Processes incoming command reply packet. The command reply packet may
-   be destined to one of our clients or it may directly for us. We will 
-   call the command reply routine after processing the packet. */
+/* Relays received command reply packet to the correct destination. The
+   destination must be one of our locally connected client or the packet
+   will be ignored. This is called when server has forwarded one of
+   client's command request to router and router has now replied to the 
+   command. */
 
 void silc_server_command_reply(SilcServer server,
                               SilcSocketConnection sock,
index 710e88a055769a5648d6a9b7350f96f0221cfca4..72e509f9b6b48e98ba506cbe4aa7ec47b9f1725d 100644 (file)
@@ -26,9 +26,9 @@
 void silc_server_private_message(SilcServer server,
                                 SilcSocketConnection sock,
                                 SilcPacketContext *packet);
-void silc_server_packet_relay_command_reply(SilcServer server,
-                                           SilcSocketConnection sock,
-                                           SilcPacketContext *packet);
+void silc_server_command_reply(SilcServer server,
+                              SilcSocketConnection sock,
+                              SilcPacketContext *packet);
 void silc_server_channel_message(SilcServer server,
                                 SilcSocketConnection sock,
                                 SilcPacketContext *packet);
index 2b1575fd531898b1d2f2fe021946f52c9e9b53c8..7d2c9584a93493152086caaa0b0ead7b209d871c 100644 (file)
@@ -739,6 +739,7 @@ SILC_TASK_CALLBACK(silc_server_connect_to_router_final)
   sock->type = SILC_SOCKET_TYPE_ROUTER;
   server->id_entry->router = id_entry;
   server->router = id_entry;
+  server->router->data.registered = TRUE;
 
  out:
   /* Free the temporary connection data context */
@@ -1326,7 +1327,7 @@ void silc_server_packet_parse_type(SilcServer server,
      * This must be the case here or we will ignore the packet.
      */
     SILC_LOG_DEBUG(("Command Reply packet"));
-    silc_server_packet_relay_command_reply(server, sock, packet);
+    silc_server_command_reply(server, sock, packet);
     break;
 
     /*
index a4719076f28242534fce4fba9de5fb322593c97e..cb26745f0b2874b9fc43a1691a3236810306077f 100644 (file)
@@ -1,8 +1,8 @@
 [Cipher]
-rc6:/home/priikone/silc/lib/silcsim/modules/rc6.sim.so:16:16
-twofish:/home/priikone/silc/lib/silcsim/modules/twofish.sim.so:16:16
-mars:/home/priikone/silc/lib/silcsim/modules/mars.sim.so:16:16
-none:/home/priikone/silc/lib/silcsim/modules/none.sim.so:0:0
+rc6:/home/silc/silc/lib/silcsim/modules/rc6.sim.so:16:16
+twofish:/home/silc/silc/lib/silcsim/modules/twofish.sim.so:16:16
+mars:/home/silc/silc/lib/silcsim/modules/mars.sim.so:16:16
+none:/home/silc/silc/lib/silcsim/modules/none.sim.so:0:0
 
 [HashFunction]
 md5::64:16
@@ -16,10 +16,10 @@ sha1::64:20
 Mun huone:Mun servo:Pekka Riikonen:priikone@poseidon.pspt.fi
 
 [ServerInfo]
-lassi.kuo.fi.ssh.com:10.2.1.6:Kuopio, Finland:1334
+lassi.kuo.fi.ssh.com:10.2.1.7:Kuopio, Finland:1334
 
 [ListenPort]
-10.2.1.6:10.2.1.6:1334
+10.2.1.7:10.2.1.7:1334
 
 [Logging]
 infologfile:silcd2.log:10000
@@ -32,19 +32,18 @@ errorlogfile:silcd2.log:10000
 2:200:300:400
 
 [ClientConnection]
-10.2.1.199:passwd:priikone:333:1
 :::1333:1
 :::1334:1
 :::1335:1
+:::1336:1
 
 [AdminConnection]
-10.2.1.199:passwd:priikone:priikone:1
 
 [ServerConnection]
-10.2.1.6:passwd:priikone:1335:1:1
+10.2.1.7:passwd:priikone:1333:1:1
 
 [RouterConnection]
-10.2.1.6:passwd:priikone:1335:1:1:0
+10.2.1.7:passwd:priikone:1335:1:1:1
 
 [DenyConnection]
 [RedirectClient]