aboutsummaryrefslogtreecommitdiff
path: root/protocols/inspircd3.c
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2024-07-24 04:34:17 -0400
committerTest_User <hax@andrewyu.org>2024-07-24 04:34:29 -0400
commitf097bc9a2db4ac103b20f4680722dc7d46fad7b3 (patch)
treee84e4093394db899a165796765fc11076564be7f /protocols/inspircd3.c
parentba9b6325705e828c29c8e433beba5ad3ff5bb639 (diff)
downloadhaxircd-f097bc9a2db4ac103b20f4680722dc7d46fad7b3.tar.gz
haxircd-f097bc9a2db4ac103b20f4680722dc7d46fad7b3.zip
Fix cross-protocol netsplit propagations
Diffstat (limited to 'protocols/inspircd3.c')
-rw-r--r--protocols/inspircd3.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/protocols/inspircd3.c b/protocols/inspircd3.c
index 7457938..9d09831 100644
--- a/protocols/inspircd3.c
+++ b/protocols/inspircd3.c
@@ -573,7 +573,27 @@ void inspircd3_protocol_propagate_new_server(struct string from, struct string a
}
// [:source] SQUIT <sid> [<reason>?]
+void inspircd3_protocol_propagate_remove_server(struct string from, struct server_info *server, struct string reason) {
+ if (server->protocol == INSPIRCD3_PROTOCOL)
+ return;
+
+ inspircd3_protocol_propagate(from, STRING(":"));
+ inspircd3_protocol_propagate(from, SID);
+ inspircd3_protocol_propagate(from, STRING(" SQUIT "));
+ inspircd3_protocol_propagate(from, server->sid);
+ inspircd3_protocol_propagate(from, STRING(" :"));
+ if (reason.len != 0)
+ inspircd3_protocol_propagate(from, reason);
+ else
+ inspircd3_protocol_propagate(from, STRING(" "));
+ inspircd3_protocol_propagate(from, STRING("\n"));
+}
+
+// [:source] SQUIT <sid> [<reason>?]
void inspircd3_protocol_propagate_unlink_server(struct string from, struct server_info *a, struct server_info *b, size_t protocol) {
+ if (protocol != INSPIRCD3_PROTOCOL)
+ return;
+
struct server_info *source;
struct server_info *target;
if (a->distance == 0 && !STRING_EQ(a->sid, SID)) {
@@ -587,10 +607,7 @@ void inspircd3_protocol_propagate_unlink_server(struct string from, struct serve
}
inspircd3_protocol_propagate(from, STRING(":"));
- if (protocol == INSPIRCD3_PROTOCOL)
- inspircd3_protocol_propagate(from, source->sid);
- else
- inspircd3_protocol_propagate(from, SID);
+ inspircd3_protocol_propagate(from, source->sid);
inspircd3_protocol_propagate(from, STRING(" SQUIT "));
inspircd3_protocol_propagate(from, target->sid);
inspircd3_protocol_propagate(from, STRING(" : \n"));