updates
authorPekka Riikonen <priikone@silcnet.org>
Wed, 30 Jan 2002 11:33:31 +0000 (11:33 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 30 Jan 2002 11:33:31 +0000 (11:33 +0000)
CHANGES
apps/silcd/command_reply.c

diff --git a/CHANGES b/CHANGES
index 14f2f245f9418efb4744b6955a0cfe4af754ba98..96fd1d61516baf9a58b21fd8db94a287aa52b9b3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,15 @@ Wed Jan 30 11:11:47 CET 2002  Pekka Riikonen <priikone@silcnet.org>
          sender's command context, fixed now.  The affected file is
          silcd/command.c.
 
+       * Create the key in JOIN command of the router did not return
+         the channel key, added check for this.  Affected file is
+         silcd/command.c.
+
+       * Fixed a channel ID update bug in JOIN command reply.  Do
+         not directly upgrade the ID but call the function
+         silc_idlist_replace_channel_id if the ID was changed.
+         Affected file silcd/command_reply.c.
+
 Tue Jan 29 19:49:31 EET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Applied patches from cras:
index 0b4ca602d8a4105fdf7f2bf0da8c2132a16f4fff..d9fbe6a8e603c85027c532c6714fffd6673b0540 100644 (file)
@@ -823,6 +823,8 @@ SILC_SERVER_CMD_REPLY_FUNC(join)
     silc_buffer_pull_tail(keyp, SILC_BUFFER_END(keyp));
     silc_buffer_put(keyp, tmp, len);
   }
+
+  /* Parse the Channel ID */
   id = silc_id_payload_parse_id(id_string, id_len);
   if (!id)
     goto out;
@@ -891,19 +893,19 @@ SILC_SERVER_CMD_REPLY_FUNC(join)
     server->stat.my_channels++;
   } else {
     /* The entry exists. */
-    silc_free(cache->id);
-    entry->id = id;
-    cache->id = entry->id;
+
+    /* If ID has changed, then update it to the cache too. */
+    if (!SILC_ID_CHANNEL_COMPARE(channel->id, id))
+      silc_idlist_replace_channel_id(server->local_list, channel->id, id);
+
     entry->disabled = FALSE;
 
     /* Remove the founder auth data if the mode is not set but we have
        them in the entry */
     if (!(mode & SILC_CHANNEL_MODE_FOUNDER_AUTH) && entry->founder_key) {
       silc_pkcs_public_key_free(entry->founder_key);
-      if (entry->founder_passwd) {
-       silc_free(entry->founder_passwd);
-       entry->founder_passwd = NULL;
-      }
+      silc_free(entry->founder_passwd);
+      entry->founder_passwd = NULL;
     }
   }