Skip to content

feat(upnp): emit local listen address when a port is mapped - #6121

Merged
mergify[bot] merged 1 commit into
libp2p:masterfrom
RolandSherwin:upnp_local_adapter
Sep 11, 2025
Merged

feat(upnp): emit local listen address when a port is mapped#6121
mergify[bot] merged 1 commit into
libp2p:masterfrom
RolandSherwin:upnp_local_adapter

Conversation

@RolandSherwin

@RolandSherwin RolandSherwin commented Aug 8, 2025

Copy link
Copy Markdown
Contributor

Description

This PR aims to expose the local listen address for a corresponding successful port-map to the end user. It would be great to know which local adapter was successfully mapped, when the user has multiple local adapters that they're listening on.

Note: #6127 and #6128 were part of the original PR.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

@RolandSherwin RolandSherwin changed the title fix(upnp): skip port mapping when an active port mapping is present fix(upnp): prevent inf retry loop & skipping valid listeners Aug 8, 2025

@jxs jxs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, and thanks for this!
Can you split this into the 3 different PR's? (preferably in a sequential way)
We prefer to have a small CHANGELOG.md entry linking to a PR that explains and shows the conversation for the PR itself

@jacderida

Copy link
Copy Markdown

Hi, and thanks for this! Can you split this into the 3 different PR's? (preferably in a sequential way) We prefer to have a small CHANGELOG.md entry linking to a PR that explains and shows the conversation for the PR itself

I work in the same team as Roland, and I'm sure it would be possible.

I wanted to ask about doing a release fairly soon after the PRs were merged. Would that be possible?

@RolandSherwin RolandSherwin changed the title fix(upnp): prevent inf retry loop & skipping valid listeners feat(upnp): emit local listen address when a port is mapped Aug 11, 2025
@RolandSherwin

Copy link
Copy Markdown
Contributor Author

Hey @jxs! I've created 2 more PRs to separate out the work #6127 and #6128. The changelogs for those PRs are under 0.6.0, to avoid conflicts if we're gonna marge all 3 together. Please let me know if that is not desirable.

Comment thread protocols/upnp/src/behaviour.rs Outdated

@ackintosh ackintosh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@jxs jxs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! @RolandSherwin, can you fix the conflicts?
Thanks

@mergify

mergify Bot commented Sep 8, 2025

Copy link
Copy Markdown
Contributor

This pull request has merge conflicts. Could you please resolve them @RolandSherwin? 🙏

@RolandSherwin

Copy link
Copy Markdown
Contributor Author

Fixed it, thanks @jxs!

@jxs jxs added the send-it label Sep 11, 2025
@mergify
mergify Bot merged commit 4b50fec into libp2p:master Sep 11, 2025
69 of 70 checks passed
@RolandSherwin

Copy link
Copy Markdown
Contributor Author

Hey @jxs , would it be possible to do a new release of libp2p with these new changes? These changes are required for a feature inside the Autonomi Project that I'm working on. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants