]> jfr.im git - irc/freenode/solanum.git/commitdiff
Get rid of hub_mask/leaf_mask
authorEd Kellett <redacted>
Sat, 14 Nov 2020 18:00:20 +0000 (18:00 +0000)
committerEd Kellett <redacted>
Sat, 14 Nov 2020 18:22:08 +0000 (18:22 +0000)
15 files changed:
doc/ircd.conf.example
doc/reference.conf
help/opers/stats
help/users/stats
include/s_conf.h
include/s_newconf.h
ircd/newconf.c
ircd/s_conf.c
ircd/s_newconf.c
modules/core/m_server.c
modules/m_info.c
modules/m_stats.c
testsuite/ircd.conf.1
testsuite/ircd.conf.2
testsuite/ircd.conf.3

index 159ddf744c1bdcca1affd489c4d13c5251d5c2d9..ab1f940ceacbfeed396766e28d8ee8ebdf90d5d4 100644 (file)
@@ -311,7 +311,6 @@ connect "irc.uplink.com" {
        send_password = "password";
        accept_password = "anotherpassword";
        port = 6666;
-       hub_mask = "*";
        class = "server";
        flags = compressed, topicburst;
 
@@ -323,7 +322,6 @@ connect "ssl.uplink.com" {
        send_password = "password";
        accept_password = "anotherpassword";
        port = 9999;
-       hub_mask = "*";
        class = "server";
        flags = ssl, topicburst;
 };
@@ -586,7 +584,6 @@ general {
        use_propagated_bans = yes;
        stats_e_disabled = no;
        stats_c_oper_only = no;
-       stats_h_oper_only = no;
        stats_y_oper_only = no;
        stats_o_oper_only = yes;
        stats_P_oper_only = no;
index 5831c8f6e98a479f18e94d34fc8655e00e9bd8b0..e17e70ba86d1608d4004f6679830d6cb2286bfb5 100644 (file)
@@ -574,16 +574,6 @@ connect "irc.uplink.com" {
        /* port: the port to connect to this server on */
        port = 6666;
 
-       /* hub mask: the mask of servers that this server may hub. Multiple
-        * entries are permitted
-        */
-       hub_mask = "*";
-
-       /* leaf mask: the mask of servers this server may not hub.  Multiple
-        * entries are permitted.  Useful for forbidding EU -> US -> EU routes.
-        */
-       #leaf_mask = "*.uk";
-
        /* class: the class this server is in */
        class = "server";
 
@@ -620,7 +610,6 @@ connect "ssl.uplink.com" {
        send_password = "password";
        accept_password = "anotherpassword";
        port = 9999;
-       hub_mask = "*";
        class = "server";
        flags = ssl, topicburst;
 };
@@ -1189,9 +1178,6 @@ general {
        /* stats c oper only: make stats c (connect {}) oper only */
        stats_c_oper_only = no;
 
-       /* stats h oper only: make stats h (hub_mask/leaf_mask) oper only */
-       stats_h_oper_only = no;
-
        /* stats y oper only: make stats y (class {}) oper only */
        stats_y_oper_only = no;
 
index 9461e5b75cf396bc6618da492ee03a4b6c8fcdd0..5c91d7d63a1dc5cbcb60f94bfa3cf7b4b75f3d23 100644 (file)
@@ -17,7 +17,6 @@ X B - Shows hash statistics
 X E - Shows Events
 X f - Shows File Descriptors
 * g - Shows global K lines
-^ h - Shows hub_mask/leaf_mask (Old H:/L: lines)
 ^ i - Shows auth blocks (Old I: lines)
 ^ K - Shows K lines (or matched klines)
 ^ k - Shows temporary K lines (or matched klines)
index 2538159f05bd82979f9f6fcf93e4ca90b6d5e506..15026033d9ce29053be0537fba0e5986ab096ed5 100644 (file)
@@ -7,7 +7,6 @@ server parameter is given) for info corresponding to
 LETTER
 ------ (^ = Can be configured to be oper only.)
 ^ c - Shows connect blocks
-^ h - Shows hub_mask/leaf_mask (Old H:/L: lines)
 ^ i - Shows auth blocks (or matched auth block)
 ^ K - Shows K lines (or matched klines)
 ^ k - Shows temporary K lines (or matched klines)
index a689bf31159f5bb9260285cc1216115f626e4f97..7b9fdc2b91ed090076cb0aa7f53ae690046c07eb 100644 (file)
@@ -194,7 +194,6 @@ struct config_file_entry
        int stats_e_disabled;
        int stats_c_oper_only;
        int stats_y_oper_only;
-       int stats_h_oper_only;
        int stats_o_oper_only;
        int stats_k_oper_only;
        enum stats_l_oper_only stats_l_oper_only;
@@ -301,7 +300,6 @@ struct server_info
        char sid[4];
        char *description;
        char *network_name;
-       int hub;
        struct rb_sockaddr_storage bind4;
        struct rb_sockaddr_storage bind6;
        int default_max_clients;
index 118fc50422e304d9a67bd414b31903c23bf74f0c..01cd8992522d5b0e23c9fb5ded71d57bd1de0d3c 100644 (file)
@@ -44,7 +44,6 @@ struct ConfItem;
 
 extern rb_dlink_list cluster_conf_list;
 extern rb_dlink_list oper_conf_list;
-extern rb_dlink_list hubleaf_conf_list;
 extern rb_dlink_list server_conf_list;
 extern rb_dlink_list xline_conf_list;
 extern rb_dlink_list resv_conf_list;
@@ -68,7 +67,7 @@ typedef struct
 void add_tgchange(const char *host);
 tgchange *find_tgchange(const char *host);
 
-/* shared/cluster/hub/leaf confs */
+/* cluster confs */
 struct remote_conf
 {
        char *username;
@@ -102,10 +101,6 @@ struct remote_conf
                        SHARED_TRESV | SHARED_PRESV | SHARED_UNRESV | SHARED_GRANT)
 #define CLUSTER_ALL    (SHARED_ALL | SHARED_LOCOPS)
 
-/* flags used in hub/leaf */
-#define CONF_HUB       0x0001
-#define CONF_LEAF      0x0002
-
 struct oper_conf
 {
        char *name;
index e00d4a716c63d19aea9973af4c031e974353f263..72441907b16b1d65ac066e7162a58fd7d53812fe 100644 (file)
@@ -1349,38 +1349,6 @@ conf_set_connect_flags(void *data)
        set_modes_from_table(&yy_server->flags, "flag", connect_table, args);
 }
 
-static void
-conf_set_connect_hub_mask(void *data)
-{
-       struct remote_conf *yy_hub;
-
-       if(EmptyString(yy_server->name))
-               return;
-
-       yy_hub = make_remote_conf();
-       yy_hub->flags = CONF_HUB;
-
-       yy_hub->host = rb_strdup(data);
-       yy_hub->server = rb_strdup(yy_server->name);
-       rb_dlinkAdd(yy_hub, &yy_hub->node, &hubleaf_conf_list);
-}
-
-static void
-conf_set_connect_leaf_mask(void *data)
-{
-       struct remote_conf *yy_leaf;
-
-       if(EmptyString(yy_server->name))
-               return;
-
-       yy_leaf = make_remote_conf();
-       yy_leaf->flags = CONF_LEAF;
-
-       yy_leaf->host = rb_strdup(data);
-       yy_leaf->server = rb_strdup(yy_server->name);
-       rb_dlinkAdd(yy_leaf, &yy_leaf->node, &hubleaf_conf_list);
-}
-
 static void
 conf_set_connect_class(void *data)
 {
@@ -2652,8 +2620,6 @@ static struct ConfEntry conf_connect_table[] =
        { "vhost",      CF_QSTRING, conf_set_connect_vhost,     0, NULL },
        { "port",       CF_INT,     conf_set_connect_port,      0, NULL },
        { "aftype",     CF_STRING,  conf_set_connect_aftype,    0, NULL },
-       { "hub_mask",   CF_QSTRING, conf_set_connect_hub_mask,  0, NULL },
-       { "leaf_mask",  CF_QSTRING, conf_set_connect_leaf_mask, 0, NULL },
        { "class",      CF_QSTRING, conf_set_connect_class,     0, NULL },
        { "\0", 0, NULL, 0, NULL }
 };
@@ -2727,7 +2693,6 @@ static struct ConfEntry conf_general_table[] =
        { "short_motd",         CF_YESNO, NULL, 0, &ConfigFileEntry.short_motd          },
        { "stats_c_oper_only",  CF_YESNO, NULL, 0, &ConfigFileEntry.stats_c_oper_only   },
        { "stats_e_disabled",   CF_YESNO, NULL, 0, &ConfigFileEntry.stats_e_disabled    },
-       { "stats_h_oper_only",  CF_YESNO, NULL, 0, &ConfigFileEntry.stats_h_oper_only   },
        { "stats_o_oper_only",  CF_YESNO, NULL, 0, &ConfigFileEntry.stats_o_oper_only   },
        { "stats_P_oper_only",  CF_YESNO, NULL, 0, &ConfigFileEntry.stats_P_oper_only   },
        { "stats_y_oper_only",  CF_YESNO, NULL, 0, &ConfigFileEntry.stats_y_oper_only   },
index 1262dccac4afe364358408d463d1013ea395f279..e33dafa4f57c805814bafb517df997ddf53106c0 100644 (file)
@@ -743,7 +743,6 @@ set_default_conf(void)
        ConfigFileEntry.stats_P_oper_only = false;
        ConfigFileEntry.stats_c_oper_only = false;
        ConfigFileEntry.stats_y_oper_only = false;
-       ConfigFileEntry.stats_h_oper_only = false;
        ConfigFileEntry.map_oper_only = true;
        ConfigFileEntry.operspy_admin_only = false;
        ConfigFileEntry.pace_wait = 10;
index 253b869d317deabbb627bc7c11ed47a9a489ad1c..8fc86af58d9b25017c0f55c0bbd5f668ae7936d8 100644 (file)
@@ -48,7 +48,6 @@
 
 rb_dlink_list cluster_conf_list;
 rb_dlink_list oper_conf_list;
-rb_dlink_list hubleaf_conf_list;
 rb_dlink_list server_conf_list;
 rb_dlink_list xline_conf_list;
 rb_dlink_list resv_conf_list;  /* nicks only! */
@@ -87,12 +86,6 @@ clear_s_newconf(void)
                free_remote_conf(ptr->data);
        }
 
-       RB_DLINK_FOREACH_SAFE(ptr, next_ptr, hubleaf_conf_list.head)
-       {
-               rb_dlinkDelete(ptr, &hubleaf_conf_list);
-               free_remote_conf(ptr->data);
-       }
-
        RB_DLINK_FOREACH_SAFE(ptr, next_ptr, oper_conf_list.head)
        {
                free_oper_conf(ptr->data);
index 42482d0d73863b87f90d23c9a1c124f739027dba..e0702bfddd7dd5b766fa039fe9a8d7d56b3e4038 100644 (file)
@@ -341,12 +341,8 @@ ms_server(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
        /* same size as in s_misc.c */
        const char *name;
        struct Client *target_p;
-       struct remote_conf *hub_p;
        hook_data_client hdata;
        int hop;
-       int hlined = 0;
-       int llined = 0;
-       rb_dlink_node *ptr;
        char squitreason[160];
 
        name = parv[1];
@@ -412,82 +408,6 @@ ms_server(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *sourc
         * server links...
         */
 
-       /*
-        * See if the newly found server is behind a guaranteed
-        * leaf. If so, close the link.
-        *
-        */
-       RB_DLINK_FOREACH(ptr, hubleaf_conf_list.head)
-       {
-               hub_p = ptr->data;
-
-               if(match(hub_p->server, client_p->name) && match(hub_p->host, name))
-               {
-                       if(hub_p->flags & CONF_HUB)
-                               hlined++;
-                       else
-                               llined++;
-               }
-       }
-
-       /* Ok, this way this works is
-        *
-        * A server can have a CONF_HUB allowing it to introduce servers
-        * behind it.
-        *
-        * connect {
-        *            name = "irc.bighub.net";
-        *            hub_mask="*";
-        *            ...
-        *
-        * That would allow "irc.bighub.net" to introduce anything it wanted..
-        *
-        * However
-        *
-        * connect {
-        *            name = "irc.somehub.fi";
-        *            hub_mask="*";
-        *            leaf_mask="*.edu";
-        *...
-        * Would allow this server in finland to hub anything but
-        * .edu's
-        */
-
-       /* Ok, check client_p can hub the new server */
-       if(!hlined)
-       {
-               /* OOOPs nope can't HUB */
-               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "Non-Hub link %s introduced %s.",
-                                    client_p->name, name);
-               ilog(L_SERVER, "Non-Hub link %s introduced %s.",
-                       client_p->name, name);
-
-               snprintf(squitreason, sizeof squitreason,
-                               "No matching hub_mask for %s",
-                               name);
-               exit_client(NULL, client_p, &me, squitreason);
-               return;
-       }
-
-       /* Check for the new server being leafed behind this HUB */
-       if(llined)
-       {
-               /* OOOPs nope can't HUB this leaf */
-               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
-                                    "Link %s introduced leafed server %s.",
-                                    client_p->name, name);
-               ilog(L_SERVER, "Link %s introduced leafed server %s.",
-                       client_p->name, name);
-
-               snprintf(squitreason, sizeof squitreason,
-                               "Matching leaf_mask for %s",
-                               name);
-               exit_client(NULL, client_p, &me, squitreason);
-               return;
-       }
-
-
-
        if(strlen(name) > HOSTLEN)
        {
                sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
@@ -539,11 +459,7 @@ static void
 ms_sid(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
 {
        struct Client *target_p;
-       struct remote_conf *hub_p;
        hook_data_client hdata;
-       rb_dlink_node *ptr;
-       int hlined = 0;
-       int llined = 0;
        char squitreason[160];
 
        /* collision on the name? */
@@ -605,55 +521,6 @@ ms_sid(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p
                return;
        }
 
-       /* for the directly connected server:
-        * H: allows it to introduce a server matching that mask
-        * L: disallows it introducing a server matching that mask
-        */
-       RB_DLINK_FOREACH(ptr, hubleaf_conf_list.head)
-       {
-               hub_p = ptr->data;
-
-               if(match(hub_p->server, client_p->name) && match(hub_p->host, parv[1]))
-               {
-                       if(hub_p->flags & CONF_HUB)
-                               hlined++;
-                       else
-                               llined++;
-               }
-       }
-
-       /* no matching hub_mask */
-       if(!hlined)
-       {
-               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
-                                    "Non-Hub link %s introduced %s.",
-                                    client_p->name, parv[1]);
-               ilog(L_SERVER, "Non-Hub link %s introduced %s.",
-                       client_p->name, parv[1]);
-
-               snprintf(squitreason, sizeof squitreason,
-                               "No matching hub_mask for %s",
-                               parv[1]);
-               exit_client(NULL, client_p, &me, squitreason);
-               return;
-       }
-
-       /* matching leaf_mask */
-       if(llined)
-       {
-               sendto_realops_snomask(SNO_GENERAL, L_NETWIDE,
-                                    "Link %s introduced leafed server %s.",
-                                    client_p->name, parv[1]);
-               ilog(L_SERVER, "Link %s introduced leafed server %s.",
-                       client_p->name, parv[1]);
-
-               snprintf(squitreason, sizeof squitreason,
-                               "Matching leaf_mask for %s",
-                               parv[1]);
-               exit_client(NULL, client_p, &me, squitreason);
-               return;
-       }
-
        /* ok, alls good */
        target_p = make_client(client_p);
        make_server(target_p);
index 6692951b92cc1540ddefba7d470eed82e359596a..fd9888daf1846425550c4db86e9dd5def5e95bd3 100644 (file)
@@ -406,11 +406,6 @@ static struct InfoStruct info_table[] = {
                "STATS C output is only shown to operators",
                INFO_INTBOOL_YN(&ConfigFileEntry.stats_c_oper_only),
        },
-       {
-               "stats_h_oper_only",
-               "STATS H output is only shown to operators",
-               INFO_INTBOOL_YN(&ConfigFileEntry.stats_h_oper_only),
-       },
        {
                "stats_i_oper_only",
                "STATS I output is only shown to operators",
index 5063fc6135d06283d8e559b48a19f7f19710f6ba..49588aa1eb9d2872312b586208f4416e14a4a34d 100644 (file)
@@ -104,7 +104,6 @@ static void stats_deny(struct Client *);
 static void stats_exempt(struct Client *);
 static void stats_events(struct Client *);
 static void stats_prop_klines(struct Client *);
-static void stats_hubleaf(struct Client *);
 static void stats_auth(struct Client *);
 static void stats_tklines(struct Client *);
 static void stats_klines(struct Client *);
@@ -159,8 +158,6 @@ static struct stats_cmd stats_cmd_table[256] = {
        ['f'] = HANDLER_NORM(stats_comm,        true,   NULL),
        ['F'] = HANDLER_NORM(stats_comm,        true,   NULL),
        ['g'] = HANDLER_NORM(stats_prop_klines, false,  "oper:general"),
-       ['h'] = HANDLER_NORM(stats_hubleaf,     false,  NULL),
-       ['H'] = HANDLER_NORM(stats_hubleaf,     false,  NULL),
        ['i'] = HANDLER_NORM(stats_auth,        false,  NULL),
        ['I'] = HANDLER_NORM(stats_auth,        false,  NULL),
        ['k'] = HANDLER_NORM(stats_tklines,     false,  NULL),
@@ -528,37 +525,6 @@ stats_prop_klines(struct Client *source_p)
        }
 }
 
-static void
-stats_hubleaf(struct Client *source_p)
-{
-       struct remote_conf *hub_p;
-       rb_dlink_node *ptr;
-
-       if((ConfigFileEntry.stats_h_oper_only ||
-           (ConfigServerHide.flatten_links && !IsExemptShide(source_p))) &&
-           !IsOperGeneral(source_p))
-       {
-               sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
-                                  form_str (ERR_NOPRIVILEGES));
-               return;
-       }
-
-       RB_DLINK_FOREACH(ptr, hubleaf_conf_list.head)
-       {
-               hub_p = ptr->data;
-
-               if(hub_p->flags & CONF_HUB)
-                       sendto_one_numeric(source_p, RPL_STATSHLINE,
-                                       form_str(RPL_STATSHLINE),
-                                       hub_p->host, hub_p->server);
-               else
-                       sendto_one_numeric(source_p, RPL_STATSLLINE,
-                                       form_str(RPL_STATSLLINE),
-                                       hub_p->host, hub_p->server);
-       }
-}
-
-
 static void
 stats_auth (struct Client *source_p)
 {
index b90b78ae148c5615d74c7609a4c62e4e6287d302..cb80da7b4795aa881afcd9e8adaba5730cff81d1 100644 (file)
@@ -13,7 +13,6 @@ serverinfo {
        sid = "1TT";
        description = "Testsuite";
        network_name = "Testsuite";
-       hub = yes;
        vhost = "127.0.0.1";
 };
 
@@ -53,7 +52,6 @@ connect "testsuite2." {
        port = 7602;
        send_password = "testsuite";
        accept_password = "testsuite";
-       hub_mask = "*";
        class = "server";
        flags = topicburst;
 };
@@ -63,7 +61,6 @@ connect "testsuite3." {
        port = 7603;
        send_password = "testsuite";
        accept_password = "testsuite";
-       hub_mask = "*";
        class = "server";
        flags = topicburst;
 };
index 9149aec79ed761aaa0e897e8706d675d5ab6a7c5..7218d9dd4c87be3d15aabf85b63c28203489ab37 100644 (file)
@@ -13,7 +13,6 @@ serverinfo {
        sid = "2TT";
        description = "Testsuite";
        network_name = "Testsuite";
-       hub = yes;
        vhost = "127.0.0.1";
 };
 
@@ -53,7 +52,6 @@ connect "testsuite1." {
        port = 7601;
        send_password = "testsuite";
        accept_password = "testsuite";
-       hub_mask = "*";
        class = "server";
        flags = topicburst;
 };
@@ -63,7 +61,6 @@ connect "testsuite3." {
        port = 7603;
        send_password = "testsuite";
        accept_password = "testsuite";
-       hub_mask = "*";
        class = "server";
        flags = topicburst;
 };
index 4cf2fe2569cdb74da0db9559a65ef09663b79324..24e865fdd827b8790716dda7450098453f8719f0 100644 (file)
@@ -13,7 +13,6 @@ serverinfo {
        sid = "3TT";
        description = "Testsuite";
        network_name = "Testsuite";
-       hub = yes;
        vhost = "127.0.0.1";
 };
 
@@ -53,7 +52,6 @@ connect "testsuite1." {
        port = 7601;
        send_password = "testsuite";
        accept_password = "testsuite";
-       hub_mask = "*";
        class = "server";
        flags = topicburst;
 };
@@ -63,7 +61,6 @@ connect "testsuite2." {
        port = 7602;
        send_password = "testsuite";
        accept_password = "testsuite";
-       hub_mask = "*";
        class = "server";
        flags = topicburst;
 };