Add support for overriding the NAT-PMP gateway with a nat_pmp_gateway config option#8144
Open
samvv wants to merge 3 commits intoarvidn:RC_2_0from
Open
Add support for overriding the NAT-PMP gateway with a nat_pmp_gateway config option#8144samvv wants to merge 3 commits intoarvidn:RC_2_0from
samvv wants to merge 3 commits intoarvidn:RC_2_0from
Conversation
arvidn
reviewed
Feb 14, 2026
Owner
arvidn
left a comment
There was a problem hiding this comment.
looks good, except the handling of the address string from the settings into an optional address should be improved
| error_code ignored; | ||
| std::string gateway = m_settings.get_str(settings_pack::nat_pmp_gateway); | ||
| boost::optional<address> gateway_addr; | ||
| if (gateway == "") { |
Owner
There was a problem hiding this comment.
Suggested change
| if (gateway == "") { | |
| if (gateway.empty()) { |
| if (gateway == "") { | ||
| gateway_addr = boost::none; | ||
| } else { | ||
| gateway_addr = make_address(gateway, ignored); |
Owner
There was a problem hiding this comment.
if this call fails, it would be reasonable to have gateway_addr be nullopt. Otherwise any invalid address will break NAT-PMP.
i.e. the ignored error code should not be ignored.
Owner
|
Does this look good? #8154 |
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.
As discussed in #7681, this pull request updates farcaller's changes to the latest commit on RC_2_0.
This is a fresh pull request due to the issues @qBittUser made me aware of. I started off a fresh branch and cherry-picked the relevant commits.
This hasn't been thoroughly been tested yet. This seems to fix users behind ProtonVPN not being able to seed due to the default gateway not being set. However, it's difficult to tell because I fail to find a good torrent to test (I used the Arch Linux image). I sometimes get speeds in the kilobytes instead of plain nothing, which is better than nothing but still not ideal.