Mark cache->expire = 0 in JOIN notify handling to assure that
authorPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 13:03:03 +0000 (13:03 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Sat, 7 Sep 2002 13:03:03 +0000 (13:03 +0000)
client is not expired underneath the channel.

CHANGES
apps/silcd/packet_receive.c

diff --git a/CHANGES b/CHANGES
index 11270f2f9f922aa4044941186a82c3326a19e829..eef3eac51e28357a34ef6d8742ec72fb0d9b95c2 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Sat Sep  7 16:02:09 EEST 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * In JOIN notify handling, mark that the cache entry of the
+         client cannot be expired.  Can cause crashes on normal
+         server (asserts client->channels).  Affected file is
+         silcd/packet_receive.c.
+
 Sat Sep  7 14:22:43 CEST 2002 Lubomir Sedlacik <salo@silcnet.org>
 
        * Rewritten check for POSIX threads.  Use --with-pthreads[=DIR]
index 2068c18bdf8219b817f6efa9e57d528f6ba5cc76..c0bda1432fee1a80bf82967dcf251b208ac041f0 100644 (file)
@@ -43,7 +43,7 @@ void silc_server_notify(SilcServer server,
   SilcClientEntry client = NULL, client2 = NULL;
   SilcServerEntry server_entry = NULL;
   SilcChannelClientEntry chl;
-  SilcIDCacheEntry cache;
+  SilcIDCacheEntry cache = NULL;
   SilcHashTableList htl;
   SilcUInt32 mode;
   unsigned char *tmp;
@@ -166,11 +166,11 @@ void silc_server_notify(SilcServer server,
        entry for the client. */
     client = silc_idlist_find_client_by_id(server->global_list, 
                                           client_id, server->server_type, 
-                                          NULL);
+                                          &cache);
     if (!client) {
       client = silc_idlist_find_client_by_id(server->local_list, 
                                             client_id, server->server_type,
-                                            NULL);
+                                            &cache);
       if (!client) {
        /* If router did not find the client the it is bogus */
        if (server->server_type != SILC_SERVER) {
@@ -239,6 +239,10 @@ void silc_server_notify(SilcServer server,
     channel->user_count++;
     channel->disabled = FALSE;
 
+    /* Make sure we don't expire clients that are on channel */
+    if (cache)
+      cache->expire = 0;
+
     /* Update statistics */
     if (server->server_type == SILC_ROUTER) {
       if (sock->type != SILC_SOCKET_TYPE_ROUTER)