From 29946ace2fed75840585e80ee44071e16799cd35 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Mon, 9 May 2005 09:59:49 +0000 Subject: [PATCH] Fixed channel pk list saving on JOIN command reply on backup router. --- CHANGES | 5 +++++ apps/silcd/command_reply.c | 2 +- apps/silcd/packet_receive.c | 7 +++++-- apps/silcd/server_util.c | 8 ++++---- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/CHANGES b/CHANGES index 0279f209..3bc0fa28 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Mon May 9 12:00:08 EEST 2005 Pekka Riikonen + + * Fixed channel public key list saving on JOIN command reply + on backup router. Affected file apps/silcd/command_reply.c. + Mon May 2 10:42:49 EEST 2005 Pekka Riikonen * Added default limit how many channels client can join, diff --git a/apps/silcd/command_reply.c b/apps/silcd/command_reply.c index 198b7167..506c7f1e 100644 --- a/apps/silcd/command_reply.c +++ b/apps/silcd/command_reply.c @@ -1219,7 +1219,7 @@ SILC_SERVER_CMD_REPLY_FUNC(join) /* Get channel public key list */ tmp = silc_argument_get_arg_type(cmd->args, 16, &len); - if (tmp && server->server_type == SILC_SERVER) + if (tmp && server->server_type != SILC_ROUTER) silc_server_set_channel_pk_list(server, NULL, entry, tmp, len); /* The the user limit */ diff --git a/apps/silcd/packet_receive.c b/apps/silcd/packet_receive.c index fa24ff21..86c17cc2 100644 --- a/apps/silcd/packet_receive.c +++ b/apps/silcd/packet_receive.c @@ -613,7 +613,7 @@ void silc_server_notify(SilcServer server, /* If we received same mode from our primary check whether founder mode and key in the notify is set. We update the founder key here since we may have wrong one */ - if (server->server_type == SILC_SERVER && + if (server->server_type != SILC_ROUTER && sock == SILC_PRIMARY_ROUTE(server) && mode & SILC_CHANNEL_MODE_FOUNDER_AUTH) { SILC_LOG_DEBUG(("Founder public key received from router")); @@ -811,7 +811,10 @@ void silc_server_notify(SilcServer server, /* Process channel public key(s). */ tmp = silc_argument_get_arg_type(args, 7, &tmp_len); if (tmp && mode & SILC_CHANNEL_MODE_CHANNEL_AUTH) { - SilcStatus ret = + SilcStatus ret; + SILC_LOG_DEBUG(("Channel public key list received from router")); + + ret = silc_server_set_channel_pk_list(server, sock, channel, tmp, tmp_len); /* If list was set already we will enforce the same list to server. */ diff --git a/apps/silcd/server_util.c b/apps/silcd/server_util.c index 162cb06b..05197afc 100644 --- a/apps/silcd/server_util.c +++ b/apps/silcd/server_util.c @@ -1893,7 +1893,7 @@ bool silc_server_inviteban_process(SilcServer server, SilcHashTable list, tmp = silc_argument_get_first_arg(args, &type, &len); while (tmp) { if (type == 1) { - /* Check validity of the string. Actually we should parse the + /* Check validity of the string. Actually we should parse the whole string and verify all components individually. */ if (!silc_utf8_valid(tmp, len) || !len) { tmp = silc_argument_get_next_arg(args, &type, &len); @@ -1983,7 +1983,7 @@ bool silc_server_inviteban_process(SilcServer server, SilcHashTable list, tmp = silc_argument_get_first_arg(args, &type, &len); while (tmp) { if (type == 1) { - /* Check validity of the string. Actually we should parse the + /* Check validity of the string. Actually we should parse the whole string and verify all components individually. */ if (!silc_utf8_valid(tmp, len)) { tmp = silc_argument_get_next_arg(args, &type, &len); @@ -2107,8 +2107,8 @@ silc_server_process_channel_pk(SilcServer server, if (type == 0x00) { /* Add new public key to channel public key list */ - SILC_LOG_DEBUG(("Add new channel public key to channel %s", - channel->channel_name)); + SILC_LOG_DEBUG(("Add new channel public key %s to channel %s", + chpk->identifier, channel->channel_name)); /* Check for resource limit */ if (silc_hash_table_count(channel->channel_pubkeys) > 64) { -- 2.43.0