]> jfr.im git - solanum.git/commitdiff
ircd: introduce 'no-export' links
authorWilliam Pitcock <redacted>
Fri, 16 Sep 2016 22:18:55 +0000 (17:18 -0500)
committerWilliam Pitcock <redacted>
Fri, 16 Sep 2016 22:18:55 +0000 (17:18 -0500)
Links that are 'no-export' are not distributed to the rest of the IRC network (including local peers).
This provides a core primitive for 'anycasting' services (but the actual issue of synchronizing data in
a services package is left to the authors of the services package).

doc/reference.conf
include/s_newconf.h
ircd/newconf.c
ircd/s_serv.c

index 995075dfc4bf37f284b4e2b6a766878b5e83d179..c499a365bda5caecbff1cb64700d847eb1953ce1 100644 (file)
@@ -576,6 +576,7 @@ connect "irc.uplink.com" {
         * compressed   - compress traffic via ziplinks
         * topicburst   - burst topics between servers
         * ssl          - ssl/tls encrypted server connections
+        * no-export    - marks the link as a no-export link (not exported to other links)
         */
        flags = compressed, topicburst;
 };
index 4218a8282d635475468e01a805ebdbe5ae511f80..7a489b1a8f30e5ff456812c72d48148e6b97856e 100644 (file)
@@ -213,6 +213,7 @@ struct server_conf
 #define SERVER_TB              0x0010
 #define SERVER_AUTOCONN                0x0020
 #define SERVER_SSL             0x0040
+#define SERVER_NO_EXPORT       0x0080
 
 #define ServerConfIllegal(x)   ((x)->flags & SERVER_ILLEGAL)
 #define ServerConfEncrypted(x) ((x)->flags & SERVER_ENCRYPTED)
@@ -220,6 +221,7 @@ struct server_conf
 #define ServerConfTb(x)                ((x)->flags & SERVER_TB)
 #define ServerConfAutoconn(x)  ((x)->flags & SERVER_AUTOCONN)
 #define ServerConfSSL(x)       ((x)->flags & SERVER_SSL)
+#define ServerConfNoExport(x)  ((x)->flags & SERVER_NO_EXPORT)
 
 extern struct server_conf *make_server_conf(void);
 extern void free_server_conf(struct server_conf *);
index 0c89e25206348f6b45a4ab1fbc0f05d1e6fdd8cd..27207ff08c7b519d4d7f3a18e020d2cd1fc34720 100644 (file)
@@ -365,6 +365,7 @@ static struct mode_table connect_table[] = {
        { "encrypted",  SERVER_ENCRYPTED        },
        { "topicburst", SERVER_TB               },
        { "ssl",        SERVER_SSL              },
+       { "no-export",  SERVER_NO_EXPORT        },
        { NULL,         0                       },
 };
 
index 178622baf9e3c8279dcc73c227cb3782a35750a9..0025622d704e04af82d08dc5b469f6495bffd773 100644 (file)
@@ -617,6 +617,9 @@ burst_TS6(struct Client *client_p)
                if(!IsPerson(target_p))
                        continue;
 
+               if(MyClient(target_p->from) && target_p->localClient->att_sconf != NULL && ServerConfNoExport(target_p->localClient->att_sconf))
+                       continue;
+
                send_umode(NULL, target_p, 0, ubuf);
                if(!*ubuf)
                {
@@ -910,6 +913,9 @@ server_estab(struct Client *client_p)
                if(target_p == client_p)
                        continue;
 
+               if(target_p->localClient->att_sconf != NULL && ServerConfNoExport(target_p->localClient->att_sconf))
+                       continue;
+
                if(has_id(target_p) && has_id(client_p))
                {
                        sendto_one(target_p, ":%s SID %s 2 %s :%s%s",
@@ -958,6 +964,10 @@ server_estab(struct Client *client_p)
                if(IsMe(target_p) || target_p->from == client_p)
                        continue;
 
+               /* don't distribute downstream leaves of servers that are no-export */
+               if(MyClient(target_p->from) && target_p->from->localClient->att_sconf != NULL && ServerConfNoExport(target_p->from->localClient->att_sconf))
+                       continue;
+
                /* presumption, if target has an id, so does its uplink */
                if(has_id(client_p) && has_id(target_p))
                        sendto_one(client_p, ":%s SID %s %d %s :%s%s",