Bind aMule's external-connection (EC) socket to its own network interface (#330) - #499
Merged
Merged
Conversation
The interface bind added in amule-project#281 (IP_UNICAST_IF / IP_BOUND_IF) pins every socket aMule opens — including the External Connection listener — to a single interface, so ed2k/Kad cannot run over a VPN tunnel while the EC control port stays on the LAN. Decouple the EC listener with a new daemon-side setting, /ExternalConnect/ECNetworkInterface (empty = any), that binds only aMule's EC acceptor, independent of the global P2P interface pin. It sits beside the existing ECAddress IP bind, giving the EC channel both its own IP and its own interface. CLibSocketServer gains a per-server interface override; only CExternalConnListener uses it. ed2k/Kad TCP and UDP, outbound connections and HTTP keep following the global setting untouched. A "Bind to network interface" selector is added to the Remote Controls page (reusing the existing P2P label); like the other EC-listener settings it is daemon-only — hidden in the remote GUI and not carried over EC — and flagged restart-needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #330.
PR #281 added an interface bind (
IP_UNICAST_IF/IP_BOUND_IF) that pins all of aMule's sockets — including the EC listener — to one interface. That prevents running ed2k/Kad over a VPN tunnel while keeping the external-control port on the LAN.This decouples the EC listener. A new daemon-side setting,
/ExternalConnect/ECNetworkInterface(empty = any), binds only aMule's EC acceptor, independent of the global P2P interface pin. It sits beside the existingECAddressIP bind — the EC control channel now has both its own IP and its own interface.No new translatable strings. Builds clean on macOS (monolithic, remote GUI, daemon). Verified at runtime: with the EC interface pinned, a loopback EC connection is refused while the pinned-interface IP connects, and the ed2k listen socket stays bound to all interfaces.