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

Fix UPnP with many routers by supporting WANIPConnection:2 #20

Merged

Conversation

past-due
Copy link
Contributor

@past-due past-due commented Jul 3, 2024

Some routers only advertise UPnP's WANIPConnection:2 service. Apparently there are quite a lot of these routers (and many don't seem to support newer standards like NAT-PMP or PCP either).

libplum previously only checked for and handled WANIPConnection:1, causing port mapping to fail on these routers.

Fortunately WANIPConnection:2 is "fully compliant with WANIPConnection:1 service, except in cases where access control has been added". (PDF spec link: https://upnp.org/specs/gw/UPnP-gw-WANIPConnection-v2-Service.pdf)

This PR implements basic support for WANIPConnection:2, which requires very few changes (mostly just handling the different version number, plus the new 729 - ConflictWithOtherMechanisms error code).

Tested on several routers that were previously problematic - UPnP now succeeds with this patch.

@past-due past-due changed the title upnp: Support WANIPConnection:2 Fix UPnP with many routers by supporting WANIPConnection:2 Jul 4, 2024
Copy link
Owner

@paullouisageneau paullouisageneau left a comment

Choose a reason for hiding this comment

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

It looks good, thank you!

@paullouisageneau paullouisageneau merged commit ca2fa31 into paullouisageneau:master Jul 8, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants