Repository navigation
Support IGD v2 port mappings - #367
Conversation
Handle newer gateways and routers that describe ports differently. Fixes jupnp#366 Signed-off-by: Giovanni Menzano <giovanni.menzano@gmail.com>
There was a problem hiding this comment.
Pull request overview
This pull request updates the IGD port-mapping support to work with IGD v2 gateways and routers that advertise port arguments as ui4 (instead of ui2), addressing the failure described in issue #366.
Changes:
- Allow discovering IGD devices whose type is a newer version of
InternetGatewayDevice:1(e.g., v2). - Pass port arguments as strings when building
AddPortMapping/DeletePortMappingaction invocations so they can be coerced into the service-advertised port datatype. - Add unit tests covering IGD v2 discovery and
ui4port datatype handling in port-mapping callbacks.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
wborn
left a comment
There was a problem hiding this comment.
Thanks for the PR!
It looks good but it would be nice if you can prevent the potential NPEs.
There is also a test that I think could be improved.
|
Sorry for the late reply, I was away from home, and thanks for the review. I totally forgot about the npe, that of course can happen now. As for the tests, I couldn’t find any in that module, so I just added a couple of simple ones for now (maybe too naive 😅). |
Handle newer gateways and routers that describe ports differently. Added check for unset ports to avoid NPEs. Covered the IGD v2 hierarchy in tests. Fixes jupnp#366 Signed-off-by: Giovanni Menzano <giovanni.menzano@gmail.com>
|
Anyway, Spotless can be a real pain (I won’t elaborate), it kept messing with my code formatting |
|
Hi @GiovanniMenzano, the 3.0.5 release is finally published! |

Handle newer gateways and routers that describe ports differently.
Fixes #366