diff --git a/doc/reference.conf b/doc/reference.conf index 995075df..c499a365 100644 --- a/doc/reference.conf +++ b/doc/reference.conf @@ -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; }; diff --git a/include/s_newconf.h b/include/s_newconf.h index 4218a828..7a489b1a 100644 --- a/include/s_newconf.h +++ b/include/s_newconf.h @@ -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 *); diff --git a/ircd/newconf.c b/ircd/newconf.c index 0c89e252..27207ff0 100644 --- a/ircd/newconf.c +++ b/ircd/newconf.c @@ -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 }, }; diff --git a/ircd/s_serv.c b/ircd/s_serv.c index 178622ba..0025622d 100644 --- a/ircd/s_serv.c +++ b/ircd/s_serv.c @@ -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",