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

miniupnpc: Can only open IPv6 ports if XML root device description URL is set #703

Closed
Self-Hosting-Group opened this issue Jan 17, 2024 · 8 comments
Assignees

Comments

@Self-Hosting-Group
Copy link
Contributor

Self-Hosting-Group commented Jan 17, 2024

Otherwise, the URL with the IPv6 link-local address is used after discovery, which does not allow ports to be opened for IPv6 GUA addresses.

Also, the exact IPv6 address to initiate the request is not selectable, which is a limitation for client operating systems where multiple temporary IPv6 GUA addresses are typically used.

Control points that have not been authenticated and authorized as defined in IGDv2 SHOULD use their
IPv6 GUA when calling this action.
https://upnp.org/specs/gw/UPnP-gw-WANIPv6FirewallControl-v1-Service.pdf#page=17

Update: Only occurs if the daemon was compiled with UPNP_STRICT defined

@miniupnp miniupnp self-assigned this Jan 25, 2024
@miniupnp miniupnp added the waiting for feedback The reporter need to provide feedback label May 8, 2024
@miniupnp
Copy link
Owner

miniupnp commented May 8, 2024

@Self-Hosting-Group If the URL is right (with a IPv6 GUA) then miniupnpc will use the GUA.
Can you provide logs of the problem ?

@Self-Hosting-Group
Copy link
Contributor Author

Self-Hosting-Group commented May 10, 2024

It turned out that the bug was not in the client, but in the daemon. The daemon was compiled with UPNP_STRICT, which probably inadvertently disables multicasting on the IPv6 GUA, so the client only discovers the IPv6 link-local endpoint URL and not the GUA.

The following PR #738 fixes the daemon.

On the client side, the only thing missing with IPv6, if it's not too complicated, is the ability to select the IPv6 GUA address to use.

Self-Hosting-Group added a commit to Self-Hosting-Group/miniupnp that referenced this issue May 11, 2024
Self-Hosting-Group added a commit to Self-Hosting-Group/miniupnp that referenced this issue May 11, 2024
@miniupnp
Copy link
Owner

The Daemon is advertising it's GUA based URL even when using linklocal Multicast address !
please provide logs of the problem.

@Self-Hosting-Group
Copy link
Contributor Author

If daemon is compiled without UPNP_STRICT

upnpc: miniupnpc library test client, version 2.2.7.
 (c) 2005-2024 Thomas Bernard.
More information at https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/

List of UPNP devices found on the network :
 desc: http://[2001:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:20000/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

If daemon is compiled with UPNP_STRICT

upnpc: miniupnpc library test client, version 2.2.7.
 (c) 2005-2024 Thomas Bernard.
More information at https://miniupnp.tuxfamily.org/ or http://miniupnp.free.fr/

List of UPNP devices found on the network :
 desc: http://[fe80::2397:9a93:5241:1d18]:20000/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Self-Hosting-Group added a commit to Self-Hosting-Group/miniupnp that referenced this issue May 13, 2024
@miniupnp
Copy link
Owner

I have to check in the standard what address it is supposed to return in the announcement.

@miniupnp
Copy link
Owner

779a71b

@miniupnp miniupnp removed the waiting for feedback The reporter need to provide feedback label May 13, 2024
@miniupnp
Copy link
Owner

https://openconnectivity.org/upnp-specs/UPnP-arch-DeviceArchitecture-v2.0-20200417.pdf

  • p39 : « The URL specified in the LOCATION header field of the M-SEARCH response shall be reachable
    by the control point to which the response is directed »
  • p112
    • « a) Devices and control points SHALL use only the Link-Local unicast address as the source
      address and when specifying a literal IP address in LOCATION URLs in all multicast
      messages that are multicast to the Link-Local scope FF02::C for SSDP and FF02::130 for
      multicast eventing. Devices and control points SHALL listen on the Link-Local
      scope. See RFC 4862 for details of Link-Local addressing. »
    • « f) Devices and control points SHALL use an acquired ULA or GUA in all multicast messages
      as the source address and when specifying a literal IP address in LOCATION URLs that
      are multicast to the Site-Local scope addresses of either FF05::C or FF05::130 »
    • « j) When a LOCATION URL includes a literal IP address, that IP address SHALL match the
      unicast source address used to send the message. When a LOCATION URL includes a
      fully qualified domain name (FQDN), the resolution of that FQDN SHALL include the IP
      address used as the unicast source address. For example, this means that if mDNS or
      other mechanisms are used to create DNS entries, that DNS translations will need to exist
      for all of a device’s IP addresses that are used for discovery and advertisement. »

@miniupnp
Copy link
Owner

I think there is no bug in miniupnpd according to the standard.
@Self-Hosting-Group you should not enable STRICT mode if you want to revert to the more "compatible" operation.

Also I think I need to make sure that miniupnpc first use FF05::C then FF02::C

miniupnp added a commit that referenced this issue May 16, 2024
The standard mandates which IPv6 address to use in Location:

see #703
Self-Hosting-Group added a commit to Self-Hosting-Group/miniupnp that referenced this issue May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants