https://gitlab.synchro.net/main/sbbs/-/commit/22ae12212bbef5950e09ae3a
Added Files:
exec/tests/ircd/selflink.js
Modified Files:
exec/load/ircd/config.js core.js server.js unregistered.js
Log Message:
ircd: never link to a server bearing our own name
A live server exited with "InternalError: too much recursion" seconds
after an outbound link dropped, taking every user with it. The link
was to a server whose name matched our own.
Register_Unregistered_Local_Server() sets linkparent = ServerName on
every local link, so a link named after us ends up with nick and
linkparent both equal to ServerName. Server_Quit() calls netsplit()
before removing itself from Servers[], and netsplit() quits every
server whose linkparent matches this.nick -- which, for such a link,
is the link itself. quit -> netsplit -> quit until the stack ran out.
Refuse the state and survive it anyway:
- The SERVER handshake now rejects a peer using our own name. The
existing guard only consulted the Servers[] hash, which never
contains ServerName, so it could not catch this.
- Auto-connect and an operator's /CONNECT both decline a C:Line that
names us. Auto-connect does not reschedule, since such a C:Line
can never become valid.
- Read_Config_File() reports a [Server] section naming this server
and skips it, so the misconfiguration is visible at startup rather
than only when the resulting link drops.
- netsplit() skips this server, and Server_Quit() refuses to
re-enter. Together these terminate any cycle in the linkparent
graph, not just the self-referential one, so a malformed topology
from a peer degrades instead of killing the daemon.
Note this is not purely a configuration error: two servers on a
network can collide on a name without either being misconfigured, and
the daemon must not die when that link goes away.
exec/tests/ircd/selflink.js covers it: against the previous revision
the test IRCd dies with the same "too much recursion" the live server
hit, and no client can connect afterwards.
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
---
þ Synchronet þ Vertrauen þ Home of Synchronet þ [vert/cvs/bbs].synchro.net