ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/ircd-hybrid/trunk/src/conf.c
(Generate patch)

Comparing ircd-hybrid/trunk/src/conf.c (file contents):
Revision 4343 by michael, Sat Aug 2 16:58:33 2014 UTC vs.
Revision 4545 by michael, Fri Aug 22 08:46:13 2014 UTC

# Line 28 | Line 28
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"
# Line 92 | Line 93 | static int find_user_host(struct Client
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  
# Line 116 | Line 117 | conf_dns_lookup(struct MaskItem *conf)
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  
# Line 141 | Line 146 | conf_free(struct MaskItem *conf)
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  
# Line 291 | Line 295 | verify_access(struct Client *client_p)
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    {
# Line 299 | Line 303 | verify_access(struct Client *client_p)
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)
# Line 359 | Line 363 | attach_iline(struct Client *client_p, st
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);
# Line 712 | Line 716 | find_exact_name_conf(enum maskitem_type
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            }
# Line 774 | Line 776 | rehash(int sig)
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  
# Line 806 | Line 802 | set_default_conf(void)
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;
# Line 859 | Line 869 | set_default_conf(void)
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;
# Line 923 | Line 932 | validate_conf(void)
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  
# Line 1034 | Line 1040 | conf_connect_allowed(struct irc_ssaddr *
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);
# Line 1246 | Line 1252 | static void
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,
# Line 1263 | Line 1268 | clear_out_old_conf(void)
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)
# Line 1296 | Line 1302 | clear_out_old_conf(void)
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;
# Line 1324 | Line 1332 | clear_out_old_conf(void)
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()

Diff Legend

Removed lines
+ Added lines
< Changed lines (old)
> Changed lines (new)