Files
RustDeskandClaude Opus 5.5 680b60395e fix(hbbr): match IPv4 clients against the relay lists in their IPv4 form (#748)
* Match IPv4 clients against the relay lists in their IPv4 form

hbbr listens dual-stack by default, so a direct IPv4 client reaches
relay() as ::ffff:a.b.c.d. relay() checked BLACKLIST and BLOCKLIST with
that form, while the lists hold the plain IPv4 that `ba` and `Ba` are
given. A blacklisted IPv4 client was therefore never throttled, and
adding it to the blocklist did not end its session. handle_connection
already normalizes with try_into_v4 for its accept-time check; relay()
now does the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Keep IPv4-mapped list entries matching in relay()

The previous commit looked the lists up in the plain IPv4 form only, so
an entry in the ::ffff:a.b.c.d form stopped matching. That is the form
`usage` and the pairing logs print, so an admin copying an address from
them, or an existing list file holding one, lost the throttle and the
mid-session blocklist check. relay() now matches either form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Match either form of an IPv4-mapped client at accept too

handle_connection checked the blocklist in plain IPv4 form only, so an
entry in the ::ffff: form, the one usage prints, let the client connect.
If that client was the leg parked first, relay() never checks it and the
whole session ran. It now matches either form, as relay() does.

The relay() test gains a client that is not listed, which must outlive
the first list check, and a new test covers the accept check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

* Require a timeout in the list tests' unlisted cases

An unlisted client passed if relay() or the connection ended with an
error, not only if it stayed up until the timeout. Each case now names
the one outcome it expects.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JAxkkiaGp2k8okvs4MpCUq

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 15:33:32 +08:00
..
2026-10-10 17:34:18 +08:00
2026-07-24 10:56:56 +08:00
2026-07-24 10:56:56 +08:00
2023-02-08 16:45:30 +08:00
2026-07-24 10:56:56 +08:00
2021-03-19 17:25:58 +08:00
2026-10-10 16:51:29 +08:00