Skip to content

RUST-BUG-192 - Preserve Kad source UDP ports and relay eligibility #375

In progress

Description

@itlezy

Keep a valid advertised UDP port or materialize the observed port when absent. Use that effective port for deduplication, responses and restore. Apply local filter and ban eligibility to advertised buddy relays before indexing.

Compare behavior with stock eMule ac3d52e and amule-org aMule c5989ec4a. Use #164 for deterministic protocol evidence and #31 for same-revision interoperability.

Roadmap placement is Beta 3 Client gate.

Relay parser and handler evidence

Rust 99d9111 applies excluded relay IP filtering after decoding the tags. Stock ac3d52e updates relay eligibility as tags are read, so reordered input can produce different results. Stock's own publisher emits SOURCETYPE before relay data. amule-org c5989ec4a validates and deduplicates SERVERIP without the same relay filter. Rust and stock test source UDP nonzero after narrowing to the 16-bit wire port. aMule tests it before narrowing.

Earlier Rust proof covered byte order and tag selection. The loopback fixture below adds the canonical admission and reply behavior. Treat reordered tags and out-of-range integers as separate compatibility cases.

Source anchors: stock Search.cpp and KademliaUDPListener.cpp; aMule KademliaUDPListener.cpp; Rust emulebb-kad-dht/src/types/source.rs, lib.rs, and tests/kad_protocol.rs.

Registered Kad relay wire fixture

PR #394 at c958086 exercises the production UDP receive and source-store loops. Four source publications reach dispatch. Both allowed relays receive PublishRes and appear in search and the persisted cache. The valid advertised UDP port is retained even when it differs from the sender port. A publication with no UDP port tag uses the observed sender port. The filtered and banned relays receive no acknowledgment before the subsequent search response and appear in neither search nor the persisted cache.

The registered Windows core package suite passed, including 734 library tests and the integration targets. This is Rust loopback evidence for canonical wire ordering. The reordered-tag and narrowed-integer differences against stock and aMule remain separate.

Activity

  1. added
    bug
    rust
    beta3-blocker
    on Nov 25, 2026
  2. moved this from Todo to In Progress in eMuleBB Roadmapon Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    beta3-blockerbugrust

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions