Skip to content

fix(udp): short-circuit UDP file-info handler when client is banned - #192

Merged
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/aich-udp-isbanned-check
Jun 17, 2026
Merged

fix(udp): short-circuit UDP file-info handler when client is banned#192
got3nks merged 1 commit into
amule-org:masterfrom
got3nks:fix/aich-udp-isbanned-check

Conversation

@got3nks

@got3nks got3nks commented Jun 17, 2026

Copy link
Copy Markdown

Summary

Follow-up to #186, addressing point 3 of @danim7's post-merge review.

ClientUDPSocket.cpp:194 calls CheckForAggressive() on incoming UDP file-info packets but doesn't short-circuit on IsBanned() after, unlike the TCP file-request path at ClientTCPSocket.cpp:539 (and the TCP OP_AICHREQUEST path added in #186). CheckForAggressive can call Ban() when m_Aggressiveness >= 10, but the UDP handler then falls through and keeps processing the request anyway — AddAskedCount(), SetUDPPort(), SetLastUpRequest(), ProcessExtendedInfo(), and on through the rest of the case.

A freshly-banned client could keep the seeder doing work on each UDP file-info packet it sends. Small leak, same shape as the TCP gap that #186 closed.

What this changes

Mirror the TCP guard: break out of the dispatch case if IsBanned() returns true immediately after CheckForAggressive().

Verification

  • Local Mac build clean (incremental on master + this change).
  • CI to verify the other targets.

This is the smallest possible diff that brings the UDP file-info handler in line with the rest of the aggressive-check paths in the codebase.

ClientUDPSocket.cpp:194 calls CheckForAggressive() on incoming
file-info packets but doesn't check IsBanned() after, unlike the TCP
file-request path at ClientTCPSocket.cpp:539 (and the TCP
OP_AICHREQUEST path added in amule-project#186). CheckForAggressive can call
Ban() when m_Aggressiveness >= 10, but the UDP handler then falls
through and keeps processing the request anyway -- AddAskedCount(),
SetUDPPort(), SetLastUpRequest(), ProcessExtendedInfo(), etc.

A freshly-banned client could keep the seeder doing work on each UDP
file-info packet it sends. Small leak, same shape as the TCP gap that
amule-project#186 closed.

Mirror the TCP guard: break out of the dispatch case if IsBanned()
returns true. Reported by @danim7 in
amule-org#186 (comment)
(point 3).
@got3nks
got3nks merged commit 15fa282 into amule-org:master Jun 17, 2026
10 checks passed
@got3nks
got3nks deleted the fix/aich-udp-isbanned-check branch June 17, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant