Skip to content

[Needs testing] Better handling for IPv6 - #7

Open
anthonyryan1 wants to merge 1 commit into
projg2:masterfrom
anthonyryan1:master
Open

[Needs testing] Better handling for IPv6#7
anthonyryan1 wants to merge 1 commit into
projg2:masterfrom
anthonyryan1:master

Conversation

@anthonyryan1

@anthonyryan1 anthonyryan1 commented Nov 12, 2025

Copy link
Copy Markdown

This is a hypothetical fix for #6 with the caveat that I still don't have a UPnP IGD:2 router, so while I've written what I think the UPNP_AddPinhole and UPNP_DeletePinhole code should look like. That code path is entirely hopeful and has not actually been tested at all.

My hope is that by opening a PR, people with dual stack home networks can report here if they're properly downgrading to IPv4 address on unsupported routers, and an IPv6 address (with a working pinhole) on UPnP IGD:2 routers.

With enough confirmations, hopefully we can work out any bugs in the code path I wasn't able to test properly.

The part I have successfully tested is that we're now printing the IPv4 address on dual-stack networks, where we fail to open a UPnP pinhole.

That fixes my personal usage of pshs.

But given my brand new router still doesn't support pinhole. I'm guessing it may be a long time before any consumer routers actually implement this functionality and we can test the IPv6 portion of this PR.

Suggestions are welcome of course. C++ isn't one of my primary languages, so please let me know about any egregious mistakes or cases where things could be done better.

This is a hypothetical fix for projg2#6 with the caveat that I still don't
have a UPnP IGD:2 router, so while I've written what I *think* the
UPNP_AddPinhole and UPNP_DeletePinhole code should look like. That
code path is entirely hopeful and has not actually been tested at all.

My hope is that by opening a PR, people with dual stack home networks
can report here if they're properly downgrading to IPv4 address on
unsupported routers, and an IPv6 address (with a working pinhole) on
UPnP IGD:2 routers.

With enough confirmations, hopefully we can work out any bugs in the
code path I wasn't able to test properly.

The part I have successfully tested is that we're now printing the
IPv4 address on dual-stack networks, where we fail to open  a UPnP
pinhole.

That fixes my personal usage of pshs.

But given my brand new router still doesn't support pinhole. I'm
guessing it may be a long time before any consumer routers actually
implement this functionality and we can test the IPv6 portion of
this PR.

Suggestions are welcome of course. C++ isn't one of my primary
languages, so please let me know about any egregious mistakes or
cases where things could be done better.
@thesamesam
thesamesam requested a review from mgorny January 6, 2026 03:34
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.

1 participant