aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2024-07-24 15:52:19 +0800
committerTest_User <hax@andrewyu.org>2024-07-24 04:15:09 -0400
commit9ab35fb1773da839ba4c34ef623b8bf56391f4b4 (patch)
tree7528e26410c85e01e70e6c518c25f52c9b17f190
parentc30eebd1c7008d4cba8f7eea48d57843fcc1b488 (diff)
downloadhaxircd-9ab35fb1773da839ba4c34ef623b8bf56391f4b4.tar.gz
haxircd-9ab35fb1773da839ba4c34ef623b8bf56391f4b4.zip
InspIRCd v4: Don't send or expect 0 hopcount in initial SERVER
The SERVER message for directly-linked servers no longer contains the hopcount field. - :36D SERVER irc2.example.com password 0 36D :Example Server + :36D SERVER irc2.example.com password 36D :Example Server
-rw-r--r--protocols/inspircd4.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/protocols/inspircd4.c b/protocols/inspircd4.c
index 8f3d2eb..865e630 100644
--- a/protocols/inspircd4.c
+++ b/protocols/inspircd4.c
@@ -192,7 +192,7 @@ void * inspircd4_protocol_connection(void *type) {
networks[net].send(handle, SERVER_NAME);
networks[net].send(handle, STRING(" "));
networks[net].send(handle, config->out_pass);
- networks[net].send(handle, STRING(" 0 "));
+ networks[net].send(handle, STRING(" "));
networks[net].send(handle, SID);
networks[net].send(handle, STRING(" :"));
networks[net].send(handle, SERVER_FULLNAME);
@@ -1174,9 +1174,9 @@ int inspircd4_protocol_init_handle_capab(struct string source, size_t argc, stru
return 0;
}
-// SERVER <address> <password> <always 0> <SID> [key=value, ...] <name>
+// SERVER <address> <password> <SID> [key=value, ...] <name>
int inspircd4_protocol_init_handle_server(struct string source, size_t argc, struct string *argv, size_t net, void *handle, struct server_config **config, char is_incoming) {
- if (argc < 5) {
+ if (argc < 4) {
WRITES(2, STRING("[InspIRCd v4] Invalid SERVER received! (Missing parameters)\r\n"));
return -1;
}
@@ -1187,13 +1187,13 @@ int inspircd4_protocol_init_handle_server(struct string source, size_t argc, str
}
if (is_incoming) {
- *config = get_table_index(server_config, argv[3]);
+ *config = get_table_index(server_config, argv[2]);
if (!(*config)) {
WRITES(2, STRING("[InspIRCd v4] Unknown SID attempted to connect.\r\n"));
return -1;
}
} else {
- if (!STRING_EQ(argv[3], (*config)->sid)) {
+ if (!STRING_EQ(argv[2], (*config)->sid)) {
WRITES(2, STRING("[InspIRCd v4] Wrong SID given in SERVER!\r\n"));
return -1;
}
@@ -1209,7 +1209,7 @@ int inspircd4_protocol_init_handle_server(struct string source, size_t argc, str
networks[net].send(handle, SERVER_NAME);
networks[net].send(handle, STRING(" "));
networks[net].send(handle, (*config)->out_pass);
- networks[net].send(handle, STRING(" 0 "));
+ networks[net].send(handle, STRING(" "));
networks[net].send(handle, SID);
networks[net].send(handle, STRING(" :"));
networks[net].send(handle, SERVER_FULLNAME);
@@ -1248,7 +1248,7 @@ int inspircd4_protocol_init_handle_server(struct string source, size_t argc, str
free(time.data);
- if (add_server((*config)->sid, SID, argv[3], argv[0], argv[argc - 1], INSPIRCD4_PROTOCOL, net, handle) != 0) {
+ if (add_server((*config)->sid, SID, argv[2], argv[0], argv[argc - 1], INSPIRCD4_PROTOCOL, net, handle) != 0) {
WRITES(2, STRING("ERROR: Unable to add server!\r\n"));
return -1;
}