1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-28 21:26:37 +02:00
Commit Graph

10433 Commits

Author SHA1 Message Date
Bram Matthys 1feb7bbbfe Workaround gcc UBSan bug triggering -Wstringop-overread 2025-10-17 17:04:52 +02:00
Bram Matthys 23fc12c71c Update doc/unrealircd_wiki.zim (current wiki) 2025-10-17 11:25:27 +02:00
Bram Matthys f5a5dae4aa Make sanitizer question in ./Config not only enable ASan but also UBSan
(both AddressSanitizer and UndefinedBehaviorSanitizer)

This previously helped finding 8c26cec5fc

Also update the ./Config text a bit, eg about ASan not running OK on FreeBSD,
which only affects <14.2 as per https://bugs.unrealircd.org/view.php?id=6470#c23412
2025-10-17 09:27:43 +02:00
Bram Matthys ad991e9d0b Move "web" too from MODDATATYPE_CLIENT to MODDATATYPE_LOCAL_CLIENT
Since this is always about a local connection
2025-10-17 08:29:09 +02:00
Bram Matthys 8067ee3ad2 Move some modules using MODDATATYPE_CLIENT to MODDATATYPE_LOCAL_CLIENT
authprompt
blacklist
blacklistrecheck

This frees up 3 positions in MODDATATYPE_CLIENT
2025-10-17 08:25:06 +02:00
Bram Matthys 1d774de862 Add MODDATATYPE_* to MODULE for IRCOps 2025-10-17 08:19:15 +02:00
Bram Matthys b3821c3c4f Code cleanup: now that MDInfo is split by [req.type],
we don't need to check for type == req.type anymore.
2025-10-15 08:32:28 +02:00
Bram Matthys c1dff43c8d Make the "ModDataAdd: out of space" error message more helpful 2025-10-15 08:31:27 +02:00
Bram Matthys a52281dc28 Some more attempts to kill a proxy crash bug 2025-10-14 19:52:57 +02:00
Bram Matthys da703efdf4 Fix OOB write in message tag S2S parsing, introduced in 6.2.1-rc1.
This would happen if a remote server (trusted server traffic) would
come up with a 8K message tag (or actually name or value of 8K).
2025-10-14 16:51:31 +02:00
Bram Matthys 5c587e6230 Fix crash in new ISUPPORT command (if sent by remote server)
That is, trusted S2S traffic.
2025-10-14 16:44:17 +02:00
Bram Matthys 7f1d42856f Some minor rewording of release notes / adding links 2025-10-12 15:26:43 +02:00
Bram Matthys 15e367a822 ** UnrealIRCd 6.2.1-rc1 ** 2025-10-12 15:10:32 +02:00
Bram Matthys 058affe028 Fix crash with proxy { } block and if client is killed after parse_proxy_header().
Have not tried to reproduce but this could happen if the client is Z-Lined.
2025-10-11 10:22:41 +02:00
Bram Matthys 0607a63d91 Write a lot more in release notes 2025-10-10 19:21:02 +02:00
Bram Matthys 01ffa1c98f Merge branch 'unreal60_dev' of github.com:unrealircd/unrealircd into unreal60_dev 2025-10-10 08:44:15 +02:00
Bram Matthys 6a837bf669 inetntop() was using a wrong sizeof() which could trigger a message
about an overflow with eg 'STATS maxperip' (IRCOp-only command).
Also, STATS maxperip failed to return 1 in the hook, resulting in
unnecessary STATS help output after the list.
2025-10-10 08:42:38 +02:00
Rafael Grether 1182bd4430 Fix ./Config printing a message about 'make' not installed on OpenBSD (PR #321)
Replace 'make --version' check with 'command -v' for better BSD and non GNU/Linux support.
2025-10-08 09:11:47 +02:00
Bram Matthys 32570ad2f8 And let's add an IsUser() here too. This isn't a problem atm,
since it is only called from JOIN (so always a user), but you
never know in the future...
2025-10-07 18:35:16 +02:00
Bram Matthys 789ef5aa4c Fix crash due to recent commits. Don't call invisible_user_in_channel for servers. 2025-10-07 18:33:27 +02:00
Bram Matthys 99ae01edf8 Fix tls-tests after last chgs 2025-10-06 14:23:04 +02:00
Bram Matthys be8e2f4764 CI: Add -slightlyfast so ban expiry test is skipped (that one runs in BuildBot anyway)
This to keep the CI at GitHub reasonably fast.
2025-10-06 11:52:52 +02:00
Bram Matthys 7cb3b50737 run-test: add $RUNTESTFLAGS 2025-10-06 11:52:04 +02:00
Bram Matthys cfaae0533d Move testssl.sh cloning to tls-tests 2025-10-06 11:34:02 +02:00
Bram Matthys f0b6a648a3 Add CI badge to top of README 2025-10-06 11:14:16 +02:00
Bram Matthys acab7240c9 CI: Whoops.. missed the last line. 2025-10-06 11:05:24 +02:00
Bram Matthys 03423e155c GitHub Actions: add Linux CI (in addition to existing BuildBot)
We already run CI since 2014, first via Travis CI, then when it became
paid we switched to self-hosted BuildBot in 2019. Later that year
GitHub Actions came also in existence, but we already switched over to
BuildBot by then so didn't use it.

We will still use BuildBot on self-hosted to test various Ubuntu and
Debian distro versions, FreeBSD and Windows. Also, in the BuildBot we
have our own pre-build environment where we run Services tests (with
both anope and atheme), we run TLS there (again on all those distros
with various OpenSSL versions). And we also test both clang and gcc.

So what is new? Well, now we will also run a "quick test" via GitHub
Actions, like most projects out there on GitHub. Not the services test,
not the TLS tests, but simply latest Ubuntu and then clang+gcc.
The main benefit of this is that it will also show up on Pull Requests
and makes it "public" as our BuildBot page is restricted.
2025-10-06 11:01:28 +02:00
Bram Matthys 573f65efb5 Add extras/tests/tls/tls-tests.bbwrapper which i use for BuildBot 2025-10-06 10:07:22 +02:00
Bram Matthys 85ce779f93 Use $NOSERVICES instead of $FREEBSD if we want to skip services tests 2025-10-06 09:32:11 +02:00
Bram Matthys 4a3d3bf72f extras/tests/tls/tls-tests: split these off in an additional step
A side-effect is that this will keep unrealircd and services running.
2025-10-06 08:58:17 +02:00
Bram Matthys 07b99d1429 extras/build-tests/nix/build: support additional CPPFLAGS
and output something more useful.
2025-10-06 08:55:17 +02:00
Bram Matthys 326b1cd349 quit_sendto_local_common_channels(): rename some variables
Previous was way too confusing where user was actually a client and
channels was actually a membership struct. And then you got like
user->user and channels->channel. No, let's make this conform to
the same style that we use elsewhere. Who the hell wrote this !??
Oh, it seems I did :D
2025-10-05 16:23:02 +02:00
Bram Matthys 301c7915a7 Optimize +D stuff in quit_sendto_local_common_channels()
1) Similar to sendto_local_common_channels() go through local_members
   instead of all channel members
2) We have the membership info, so use user_can_see_member_fast()
2025-10-05 16:14:28 +02:00
Bram Matthys ef8394c64d Optimization: avoid find_member_link()'s where possible
This mainly affects MODE #channel +vhoaq and such. And as with all these
optimizations it mostly affects channels with more than 10 people (eg
hundreds or thousands).

Also did add_member_mode() and del_member_mode() but those are not
used by our own code because we always use fast versions anyway.
Oh yeah and the +D invisibility shit via set_user_invisible():
that one i didn't benchmark but should be better as well for
large channels.
2025-10-05 16:03:35 +02:00
Bram Matthys 5f2f020183 Make unreal_copyfile() copy in 16k chunks instead of 1k 2025-10-05 14:05:52 +02:00
Bram Matthys aaa3179676 Avoid running make_cloakedhost() twice for remote clients.
This saves around 5% unrealircd CPU in 100k remote clone tests.
2025-10-05 11:18:11 +02:00
Bram Matthys 9310c655b9 We can do the umode change by UID. Not that it matters much :D.
And parv[0] is always NULL in UnrealIRCd.
2025-10-05 11:02:02 +02:00
Bram Matthys 5b6c00946a Optimize set_user_modes_dont_spread(): use _cmd_uid() directly.
Only downside is that mtags would be NULL, but we don't use it in
cmd_uid() so that's okay. This saves us from generating mtags in
do_cmd() when we don't need it. And also a command handler lookup
and all that. Saves around 8% of unrealircd CPU for 100k connects.
2025-10-05 11:00:00 +02:00
Bram Matthys 80189a6ce9 Replace a HasCapability() with HasCapabilityFast()
Since mtags_to_string() is a function that is called a lot, this matters.
2025-10-05 10:34:25 +02:00
Bram Matthys fa8a0b2083 Make IsSynched() check if both the "far" server and the "near" server are
synched. Both need to be checked, because:
* The "far" server may be fully synched to "near" (and thus tagged as synced)
  but the "near" server may be introducing the "far" server, when
  we are connecting to "near"
* The "near" server may be fully synched but the "far" server is connecting
  in and may thus not be synched yet

In reality, things are even more complex, since one would have to verify
the whole chain of links. But.. yeah.

Long-story short: this fixes things like "User xyz joined #xxxxx" logging
where this showed up while the server was linking in. It is not supposed to
log that, similar to how we not log all 1000 users as newly connecting when
a 1000-user-server links in. In fact, it didn't already log that for
directly-connected-servers, but for far servers it did previously.

And... that again gave performance issues if you were connecting like a
100k-user far server.. since you suddenly had 100k * numchannels join events
being logged (which surprisingly still only took 6 seconds for 100k entries,
but still, it is wrong to do so and can be avoided).
2025-10-05 10:26:01 +02:00
Bram Matthys 9b493cfe6a Avoid a get_floodsettings_for_user() call for servers.
This didn't show up in initial profiling, but now that other areas
are faster, this one starts to show up with 15% for 100k-clone remote
server traffic. Easy change :D
2025-10-05 09:02:51 +02:00
Bram Matthys c729d18a8c Add (faster) remove_user_from_channel_withmb() and use it from various places.
We can use this when we already have the Membership struct, which is the
case for PART, (SA)JOIN 0 and QUIT. Saves a couple of iterations.
2025-10-05 09:01:08 +02:00
Bram Matthys af0a784464 Make member & membership point to each other so lookups can be much faster.
This also makes them proper list items, again to make certain fast operations
possible. Main thing is that removing an entry does not require us to walk
all of those lists. Not all code has been modified yet to benefit this,
actually only very little, the most performance-impacting ones.

This fixes SQUIT of a server with 100k users in a single channel taking
40 seconds of 100% CPU. It now takes only 1 second.
Reported by craftxbox in https://bugs.unrealircd.org/view.php?id=6484

(Can't make member & membership one entry atm, that would be too much change in U6)
2025-10-05 08:32:43 +02:00
Bram Matthys 55dd4601f2 Change some find_member_link() to find_membership_link() which is faster.
The first one iterates through all channel members (can be hundreds or thousands)
and the latter goes through the channels a user is in (typically <15).
2025-10-04 20:46:20 +02:00
Bram Matthys 68ef88c0c4 Move from HOOKTYPE_VISIBLE_IN_CHANNEL to invisible setting in member->memb_flags.
This so we can use fast(er) techniques here and there.

New functions are:
channel_has_invisible_users(client)
set_user_invisible(client, channel, 1|0)
Existing functions:
invisible_user_in_channel(client, channel)
user_can_see_member(user, target, channel)
user_can_see_member_fast()

This is work in progress, although the tests seem to pass atm.
2025-10-04 20:33:46 +02:00
Bram Matthys 1473f52603 Another sendto_channel() optimization in case of some PRIVMSGs.
When the channel is +H we broadcast to all servers, so we can simplify
that case and don't need to iterate the channel->members.
The same is true if set::broadcast-channel-messages is set to 'always',
though that is not known to be used much.
2025-10-04 08:50:42 +02:00
Bram Matthys e92b8ef3ad Fix uninitialized variable in sendto_channel() 2025-10-03 19:14:44 +02:00
Bram Matthys 2e21e7fdbf Make sendto_local_common_channels() use channel->local_members.
This too should be a significant performance improvement for multi-
server networks. Especially since this isn't just num_channel_members
of 1 channel, but about common channels, so could easily be like all
channel members of 10 channels combined.

This function is used for NICK, QUIT, and notification for CAP-
enabled clients for setname, account and away changes.
2025-10-03 19:13:39 +02:00
Bram Matthys cfe3ce38b2 testssl_profiles/*txt: TLS 1.2 -> TLSv1.2, etc... 2025-10-03 18:47:32 +02:00
Bram Matthys 569a12055f Add channel->local_members and use it in sendto_channel().
This makes things a lot faster on multi-server networks, especially for
big channels where most of the clients in the channel are remote users.

This should be non-module-API-breaking, as all code uses the
add_user_to_channel() and remove_user_from_channel() functions.

Still need to spread this to other code, more optimizations possible.
2025-10-03 18:11:03 +02:00