28 |
|
#include "list.h" |
29 |
|
#include "ircd_defs.h" |
30 |
|
#include "conf.h" |
31 |
+ |
#include "conf_pseudo.h" |
32 |
|
#include "server.h" |
33 |
|
#include "resv.h" |
34 |
|
#include "channel.h" |
93 |
|
* if successful save hp in the conf item it was called with |
94 |
|
*/ |
95 |
|
static void |
96 |
< |
conf_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name) |
96 |
> |
conf_dns_callback(void *vptr, const struct irc_ssaddr *addr, const char *name, size_t namelength) |
97 |
|
{ |
98 |
|
struct MaskItem *conf = vptr; |
99 |
|
|
117 |
|
if (!conf->dns_pending) |
118 |
|
{ |
119 |
|
conf->dns_pending = 1; |
120 |
< |
gethost_byname(conf_dns_callback, conf, conf->host); |
120 |
> |
|
121 |
> |
if (conf->aftype == AF_INET) |
122 |
> |
gethost_byname_type(conf_dns_callback, conf, conf->host, T_A); |
123 |
> |
else |
124 |
> |
gethost_byname_type(conf_dns_callback, conf, conf->host, T_AAAA); |
125 |
|
} |
126 |
|
} |
127 |
|
|
146 |
|
dlink_node *ptr = NULL, *ptr_next = NULL; |
147 |
|
dlink_list *list = NULL; |
148 |
|
|
149 |
< |
if (conf->node.next) |
150 |
< |
if ((list = map_to_list(conf->type))) |
146 |
< |
dlinkDelete(&conf->node, list); |
149 |
> |
if ((list = map_to_list(conf->type))) |
150 |
> |
dlinkFindDelete(list, conf); |
151 |
|
|
152 |
|
MyFree(conf->name); |
153 |
|
|
295 |
|
conf = find_address_conf(client_p->host, client_p->username, |
296 |
|
&client_p->localClient->ip, |
297 |
|
client_p->localClient->aftype, |
298 |
< |
client_p->localClient->passwd); |
298 |
> |
client_p->localClient->password); |
299 |
|
} |
300 |
|
else |
301 |
|
{ |
303 |
|
conf = find_address_conf(client_p->host,non_ident, |
304 |
|
&client_p->localClient->ip, |
305 |
|
client_p->localClient->aftype, |
306 |
< |
client_p->localClient->passwd); |
306 |
> |
client_p->localClient->password); |
307 |
|
} |
308 |
|
|
309 |
|
if (conf) |
363 |
|
|
364 |
|
ip_found = ipcache_find_or_add_address(&client_p->localClient->ip); |
365 |
|
ip_found->count++; |
366 |
< |
SetIpHash(client_p); |
366 |
> |
AddFlag(client_p, FLAGS_IPHASH); |
367 |
|
|
368 |
|
count_user_host(client_p->username, client_p->host, |
369 |
|
&global, &local, &ident); |
716 |
|
if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) |
717 |
|
return conf; |
718 |
|
break; |
715 |
– |
#ifdef IPV6 |
719 |
|
case HM_IPV6: |
720 |
|
if (who->localClient->aftype == AF_INET6) |
721 |
|
if (match_ipv6(&who->localClient->ip, &conf->addr, conf->bits)) |
722 |
|
if (!conf->class->max_total || conf->class->ref_count < conf->class->max_total) |
723 |
|
return conf; |
724 |
|
break; |
722 |
– |
#endif |
725 |
|
default: |
726 |
|
assert(0); |
727 |
|
} |
776 |
|
|
777 |
|
/* don't close listeners until we know we can go ahead with the rehash */ |
778 |
|
|
777 |
– |
/* Check to see if we magically got(or lost) IPv6 support */ |
778 |
– |
check_can_use_v6(); |
779 |
– |
|
779 |
|
read_conf_files(0); |
780 |
|
|
782 |
– |
if (ConfigServerInfo.description) |
783 |
– |
strlcpy(me.info, ConfigServerInfo.description, sizeof(me.info)); |
784 |
– |
|
781 |
|
load_conf_modules(); |
782 |
|
check_conf_klines(); |
783 |
|
|
802 |
|
assert(class_default == class_get_list()->tail->data); |
803 |
|
|
804 |
|
#ifdef HAVE_LIBCRYPTO |
805 |
+ |
#if OPENSSL_VERSION_NUMBER >= 0x1000005FL && !defined(OPENSSL_NO_ECDH) |
806 |
+ |
{ |
807 |
+ |
EC_KEY *key = EC_KEY_new_by_curve_name(NID_X9_62_prime256v1); |
808 |
+ |
|
809 |
+ |
if (key) |
810 |
+ |
{ |
811 |
+ |
SSL_CTX_set_tmp_ecdh(ConfigServerInfo.server_ctx, key); |
812 |
+ |
EC_KEY_free(key); |
813 |
+ |
} |
814 |
+ |
} |
815 |
+ |
|
816 |
+ |
SSL_CTX_set_options(ConfigServerInfo.server_ctx, SSL_OP_SINGLE_ECDH_USE); |
817 |
+ |
#endif |
818 |
+ |
|
819 |
|
ConfigServerInfo.message_digest_algorithm = EVP_sha256(); |
820 |
|
ConfigServerInfo.rsa_private_key = NULL; |
821 |
|
ConfigServerInfo.rsa_private_key_file = NULL; |
869 |
|
|
870 |
|
ConfigGeneral.away_count = 2; |
871 |
|
ConfigGeneral.away_time = 10; |
862 |
– |
ConfigGeneral.service_name = xstrdup(SERVICE_NAME_DEFAULT); |
872 |
|
ConfigGeneral.max_watch = WATCHSIZE_DEFAULT; |
873 |
|
ConfigGeneral.cycle_on_host_change = 1; |
874 |
|
ConfigGeneral.glines = 0; |
932 |
|
if (ConfigServerInfo.network_desc == NULL) |
933 |
|
ConfigServerInfo.network_desc = xstrdup(NETWORK_DESC_DEFAULT); |
934 |
|
|
926 |
– |
if (ConfigGeneral.service_name == NULL) |
927 |
– |
ConfigGeneral.service_name = xstrdup(SERVICE_NAME_DEFAULT); |
928 |
– |
|
935 |
|
ConfigGeneral.max_watch = IRCD_MAX(ConfigGeneral.max_watch, WATCHSIZE_MIN); |
936 |
|
} |
937 |
|
|
1040 |
|
* This is an event started off in ircd.c |
1041 |
|
*/ |
1042 |
|
void |
1043 |
< |
cleanup_tklines(void *notused) |
1043 |
> |
cleanup_tklines(void *unused) |
1044 |
|
{ |
1045 |
|
hostmask_expire_temporary(); |
1046 |
|
expire_tklines(&xconf_items); |
1252 |
|
clear_out_old_conf(void) |
1253 |
|
{ |
1254 |
|
dlink_node *ptr = NULL, *next_ptr = NULL; |
1249 |
– |
struct MaskItem *conf; |
1255 |
|
dlink_list *free_items [] = { |
1256 |
|
&server_items, &oconf_items, |
1257 |
|
&uconf_items, &xconf_items, |
1268 |
|
{ |
1269 |
|
DLINK_FOREACH_SAFE(ptr, next_ptr, (*iterator)->head) |
1270 |
|
{ |
1271 |
< |
conf = ptr->data; |
1271 |
> |
struct MaskItem *conf = ptr->data; |
1272 |
|
|
1273 |
< |
dlinkDelete(&conf->node, map_to_list(conf->type)); |
1273 |
> |
conf->active = 0; |
1274 |
> |
dlinkDelete(&conf->node, *iterator); |
1275 |
|
|
1276 |
|
/* XXX This is less than pretty */ |
1277 |
|
if (conf->type == CONF_SERVER || conf->type == CONF_OPER) |
1302 |
|
/* clean out module paths */ |
1303 |
|
mod_clear_paths(); |
1304 |
|
|
1305 |
+ |
pseudo_clear(); |
1306 |
+ |
|
1307 |
|
/* clean out ConfigServerInfo */ |
1308 |
|
MyFree(ConfigServerInfo.description); |
1309 |
|
ConfigServerInfo.description = NULL; |
1332 |
|
|
1333 |
|
/* clean out listeners */ |
1334 |
|
close_listeners(); |
1327 |
– |
|
1328 |
– |
/* clean out general */ |
1329 |
– |
MyFree(ConfigGeneral.service_name); |
1330 |
– |
ConfigGeneral.service_name = NULL; |
1335 |
|
} |
1336 |
|
|
1337 |
|
/* conf_add_class_to_conf() |