silc_free(entry->server_name);
if (entry->id)
silc_free(entry->id);
+
+ memset(entry, 'F', sizeof(*entry));
+ silc_free(entry);
}
}
silc_free(entry->userinfo);
if (entry->id)
silc_free(entry->id);
+
+ memset(entry, 'F', sizeof(*entry));
+ silc_free(entry);
}
}
memset(entry->key, 0, entry->key_len / 8);
silc_free(entry->key);
}
- memset(entry->iv, 0, sizeof(entry->iv));
silc_list_start(entry->user_list);
while ((chl = silc_list_get(entry->user_list)) != SILC_LIST_END) {
silc_list_del(entry->user_list, chl);
silc_free(chl);
}
+
+ memset(entry, 'F', sizeof(*entry));
+ silc_free(entry);
+ return TRUE;
}
- return TRUE;
+ return FALSE;
}
/* Finds channel by channel name. Channel names are unique and they
return channel;
}
+
+/* Replaces old Channel ID with new one. This is done when router forces
+ normal server to change Channel ID. */
+
+SilcChannelEntry
+silc_idlist_replace_channel_id(SilcIDList id_list, SilcChannelID *old_id,
+ SilcChannelID *new_id)
+{
+ SilcIDCacheEntry id_cache = NULL;
+ SilcChannelEntry channel;
+
+ if (!old_id || !new_id)
+ return NULL;
+
+ SILC_LOG_DEBUG(("Replacing Channel ID"));
+
+ if (!silc_idcache_find_by_id_one(id_list->channels, (void *)old_id,
+ SILC_ID_CHANNEL, &id_cache))
+ return NULL;
+
+ channel = (SilcChannelEntry)id_cache->context;
+ silc_free(channel->id);
+ channel->id = new_id;
+ id_cache->id = (void *)new_id;
+
+ return channel;
+}