host by checking also the type of the connection.
+Sun Mar 10 20:07:49 EET 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Fixed the server to check correctly the amount of connections
+ from single host, by checking also the type of the connection.
+ Fixed also the comparison of number of connections and number
+ of allowed connections. Affected files are silcd/server.c,
+ server_util.[ch].
+
Fri Mar 8 17:16:41 EET 2002 Pekka Riikonen <priikone@silcnet.org>
* Fixed the USERS command reply to save the user's mode on the
10. Check command reply error status types in various commands,
specifically NO_FOPRIV is missing from many commands. To be
included in protocol version 1.1.
+
+ 11. Change the wording in Private Message Key Payload definition to
+ describe the problems of trusting the payload, and to indicate that
+ the receiver may not accept the key in the payload, and to describe
+ other means of distributing a key.
+
+ 12. The router to router connection diagram in spec-xx is showing the
+ primary routers direction to wrong direction. Swap it.
entry->data.last_receive = time(NULL);
- num_sockets = silc_server_num_sockets_by_ip(server, sock->ip);
+ num_sockets = silc_server_num_sockets_by_ip(server, sock->ip,
+ ctx->conn_type);
switch (ctx->conn_type) {
case SILC_SOCKET_TYPE_CLIENT:
max_per_host = conn->param->connections_max_per_host;
}
- if (num_sockets > max_per_host) {
+ if (num_sockets >= max_per_host) {
SILC_LOG_INFO(("Too many connections from %s (%s), closing connection",
sock->hostname, sock->ip));
silc_server_disconnect_remote(server, sock,
backup_router = sconn->backup_router;
}
- if (num_sockets > max_per_host) {
+ if (num_sockets >= max_per_host) {
SILC_LOG_INFO(("Too many connections from %s (%s), closing connection",
sock->hostname, sock->ip));
silc_server_disconnect_remote(server, sock,
/* Find number of sockets by IP address indicated by `ip'. Returns 0 if
socket connections with the IP address does not exist. */
-SilcUInt32 silc_server_num_sockets_by_ip(SilcServer server, const char *ip)
+SilcUInt32 silc_server_num_sockets_by_ip(SilcServer server, const char *ip,
+ SilcSocketType type)
{
int i, count;
for (i = 0, count = 0; i < server->config->param.connections_max; i++) {
- if (server->sockets[i] && !strcmp(server->sockets[i]->ip, ip))
+ if (server->sockets[i] && !strcmp(server->sockets[i]->ip, ip) &&
+ server->sockets[i]->type == type)
count++;
}
/* Find number of sockets by IP address indicated by `ip'. Returns 0 if
socket connections with the IP address does not exist. */
-SilcUInt32 silc_server_num_sockets_by_ip(SilcServer server, const char *ip);
+SilcUInt32 silc_server_num_sockets_by_ip(SilcServer server, const char *ip,
+ SilcSocketType type);
#endif /* SERVER_UTIL_H */