Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UPNP Port Forwarding Fail On Local IP Change#698 #793

Conversation

apoorv-2204
Copy link
Contributor

@apoorv-2204 apoorv-2204 commented Dec 29, 2022

Description

Attempt to resolve upnp_port_forwarding_fail_on_local_ip_change#698.

  • If there is no redirection -> continue and forward port -> Archethic.Networking.IPLookup.NATDiscovery.MiniUPNP.open(port)
  • If there is a redirection on the same local ip -> continue and forward port (to update time limit)
    miniupnpc duration set to 0 as for mapping for a lifetime
  • If there is a redirection on a different local ip -> remove the existing redirection then continue and forward port
    Archethic.Networking.IPLookup.NATDiscovery.MiniUPNP, we expect this to fail and capture conflict mapping entry
    error .revoke that port and assigns to the node

Fixes

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • When the port forwarding fails , we capture the error, and remove port rule , and redo the rule.
    Screenshot shows working of code, trying to imitate that condition ,we expect same when node fails to port forward.

proof

Checklist:

  • My code not follows the style guidelines of this project
  • I have not performed a self-review of my own code
  • I have commented my code, particularly in easy-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate 20 new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@apoorv-2204 apoorv-2204 self-assigned this Dec 29, 2022
@apoorv-2204 apoorv-2204 changed the title attempt to resolve upnp_port_forwarding_fail_on_local_ip_change#698 UPNP Port Forwarding Fail On Local IP Change#698 Dec 29, 2022
@apoorv-2204 apoorv-2204 marked this pull request as ready for review January 3, 2023 13:17
@Neylix Neylix closed this in #805 Jan 5, 2023
@apoorv-2204 apoorv-2204 reopened this Jan 5, 2023
@apoorv-2204 apoorv-2204 added the networking Involve networking label Jan 5, 2023
Copy link
Member

@bchamagne bchamagne left a comment

Choose a reason for hiding this comment

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

Just read the code, I did not test it.

@apoorv-2204
Copy link
Contributor Author

image

Copy link
Member

@samuelmanzanera samuelmanzanera left a comment

Choose a reason for hiding this comment

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

Code seems ok

@Neylix Neylix merged commit 0ebdf95 into archethic-foundation:develop Jan 10, 2023
@apoorv-2204 apoorv-2204 deleted the upnp_port_forwarding_fail_on_local_ip_change#698 branch January 13, 2023 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
networking Involve networking
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants