+Thu Jun 27 16:54:33 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Allow heartbeat packets to go disabled connections anyway.
+ Affected files silcd/server.c and silcd/packet_send.c.
+
+ * Do not broadcast New Channel packets with List flag set
+ in the packet to backup routers. The router must check
+ for the correctness of the packets before sending them.
+ It is possible that router will have enforce Channel ID
+ change and this would cause desync in the backup router.
+ Affected file silcd/packet_receive.c.
+
+ * Remove SILC_PACKET_FLAG_LIST from the temp packets that
+ are handled in list parsing. They are not list packets
+ anymore. Affected file silcd/packet_receive.c.
+
Thu Jun 27 11:27:07 CEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Stop waiting for backup router through the timeout, not
idp->data, idp->len);
silc_buffer_free(idp);
+ /* Send KICKED notify to primary route */
+ silc_server_send_notify_kicked(server, SILC_PRIMARY_ROUTE(server),
+ SILC_BROADCAST(server), channel,
+ target_client->id, client->id, comment);
+
/* Remove the client from the channel. If the channel does not exist
after removing the client then the client kicked itself off the channel
and we don't have to send anything after that. */
target_client, FALSE))
goto out;
- /* Send KICKED notify to primary route */
- silc_server_send_notify_kicked(server, SILC_PRIMARY_ROUTE(server),
- SILC_BROADCAST(server), channel,
- target_client->id, client->id, comment);
-
if (!(channel->mode & SILC_CHANNEL_MODE_PRIVKEY)) {
/* Re-generate channel key */
if (!silc_server_create_channel_key(server, channel, 0))
data buffer, which we will here now fetch from the original buffer. */
new_id = silc_packet_context_alloc();
new_id->type = SILC_PACKET_NEW_ID;
- new_id->flags = packet->flags;
+ new_id->flags = packet->flags & (~SILC_PACKET_FLAG_LIST);
new_id->src_id = packet->src_id;
new_id->src_id_len = packet->src_id_len;
new_id->src_id_type = packet->src_id_type;
!SILC_ID_COMPARE(channel_id, server->id, server->id->ip.data_len)) {
SilcChannelID *tmp;
SILC_LOG_DEBUG(("Forcing the server to change Channel ID"));
-
if (silc_id_create_channel_id(server, server->id, server->rng, &tmp)) {
silc_server_send_notify_channel_change(server, sock, FALSE,
channel_id, tmp);
silc_free(channel_id);
- channel_id = tmp;
+ silc_free(tmp);
}
+
+ /* Wait that server re-announces this channel */
+ return;
}
/* Create the channel with the provided Channel ID */
}
}
+ /* If the sender of this packet is server and we are router we need to
+ broadcast this packet to other routers in the network. Broadcast
+ this list packet instead of multiple New Channel packets. */
+ if (server->server_type == SILC_ROUTER &&
+ sock->type == SILC_SOCKET_TYPE_SERVER &&
+ !(packet->flags & SILC_PACKET_FLAG_BROADCAST)) {
+ SILC_LOG_DEBUG(("Broadcasting received New Channel packet"));
+ silc_server_packet_send(server, SILC_PRIMARY_ROUTE(server),
+ packet->type,
+ packet->flags | SILC_PACKET_FLAG_BROADCAST,
+ packet->buffer->data,
+ packet->buffer->len, FALSE);
+ silc_server_backup_send(server, sock->user_data,
+ packet->type, packet->flags,
+ packet->buffer->data, packet->buffer->len,
+ FALSE, TRUE);
+ }
+
silc_channel_payload_free(payload);
}
server->server_type == SILC_SERVER)
return;
- /* If the sender of this packet is server and we are router we need to
- broadcast this packet to other routers in the network. Broadcast
- this list packet instead of multiple New Channel packets. */
- if (server->server_type == SILC_ROUTER &&
- sock->type == SILC_SOCKET_TYPE_SERVER &&
- !(packet->flags & SILC_PACKET_FLAG_BROADCAST)) {
- SILC_LOG_DEBUG(("Broadcasting received New Channel List packet"));
- silc_server_packet_send(server, SILC_PRIMARY_ROUTE(server),
- packet->type,
- packet->flags | SILC_PACKET_FLAG_BROADCAST,
- packet->buffer->data,
- packet->buffer->len, FALSE);
- silc_server_backup_send(server, sock->user_data,
- packet->type, packet->flags,
- packet->buffer->data, packet->buffer->len,
- FALSE, TRUE);
- }
-
/* Make copy of the original packet context, except for the actual
data buffer, which we will here now fetch from the original buffer. */
new = silc_packet_context_alloc();
new->type = SILC_PACKET_NEW_CHANNEL;
- new->flags = packet->flags;
+ new->flags = packet->flags & (~SILC_PACKET_FLAG_LIST);
new->src_id = packet->src_id;
new->src_id_len = packet->src_id_len;
new->src_id_type = packet->src_id_type;
if (backup_local)
ctx->conn_type = SILC_SOCKET_TYPE_SERVER;
new_server->server_type = SILC_BACKUP_ROUTER;
+
+ /* Remove the backup waiting with timeout */
+ silc_schedule_task_add(server->schedule, 0,
+ silc_server_backup_router_wait,
+ (void *)server, 5, 0,
+ SILC_TASK_TIMEOUT, SILC_TASK_PRI_NORMAL);
}
/* Statistics */
SILC_LOG_DEBUG(("Connection is disabled"));
goto out;
}
+ if (ret != SILC_PACKET_HEARTBEAT &&
+ idata && idata->status & SILC_IDLIST_STATUS_DISABLED) {
+ SILC_LOG_DEBUG(("Connection is disabled"));
+ goto out;
+ }
if (ret == SILC_PACKET_NONE) {
SILC_LOG_DEBUG(("Error parsing packet"));
if (!channel) {
SILC_LOG_ERROR(("Received key for non-existent channel %s",
silc_id_render(id, SILC_ID_CHANNEL)));
+ assert(FALSE);
goto out;
}
}