Skip to content

Conversation

Self-Hosting-Group
Copy link

@Self-Hosting-Group Self-Hosting-Group commented Apr 14, 2025

  • Fix GetActiveConnections -> GetActiveConnection action and add missing allowedValueRange to MaximumActiveConnections state variable to match UPnP IGD specification
  • Fix subscription timeout to match minimum of 1800s to comply with UDA specification
  • Add missing and remove pre-IGDv1 error description

Fixed in 7567a2b d2d021c df0d9ca

  • Consistent and compliant server header

Fixed in c552aac ee0254a

The Port Control Protocol (PCP) is the successor to NAT-PMP, has similar protocol concepts and packet formats, but adds support for IPv6 port maps and options/extensions. For more information, see:
Port Mapping Protocols Overview and Comparison 2025: About UPnP IGD & PCP/NAT-PMP
https://github.com/Self-Hosting-Group/wiki/wiki/Port-Mapping-Protocols-Overview

Self-Hosting-Group added a commit to Self-Hosting-Group/dd-wrt that referenced this pull request Apr 14, 2025
@Self-Hosting-Group Self-Hosting-Group force-pushed the improve-daemon branch 2 times, most recently from 5e5dfae to f075dc0 Compare April 14, 2025 15:47
@Self-Hosting-Group
Copy link
Author

@BrainSlayer Some perhaps useful PR reference links:

UPnP IGD WANCommonInterfaceConfig:1 service:
https://upnp.org/specs/gw/UPnP-gw-WANCommonInterfaceConfig-v1-Service.pdf

UDA 1.1:
https://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf

@BrainSlayer
Copy link
Contributor

is this tested?

@BrainSlayer
Copy link
Contributor

BrainSlayer commented Apr 19, 2025

especially "Server: %s/%s UPnP/1.0 upnpd/0.9.0\r\n"
the first arguments for sprintf are osname and os ver. using this has server isnt correct

@BrainSlayer
Copy link
Contributor

BrainSlayer commented Apr 19, 2025

i'm merging it now partitially. but the part which changes the http header is clearly wrong %s/%s can never be a valid Server: description. this is specified as ip or hostname but never contains slashes. in that case its just a placeholder, but it still has to be in valid format. using the osname and os version as server is wrong

@BrainSlayer
Copy link
Contributor

and parts of your patch is broken and does not compile.

soap.c: In function 'soap_send_error':
soap.c:282:14: error: 'SOAP_SPECIFIED_ARRAY_INDEX_INVALID' undeclared (first use in this function)
282 | case SOAP_SPECIFIED_ARRAY_INDEX_INVALID:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
soap.c:282:14: note: each undeclared identifier is reported only once for each function it appears in
soap.c:286:14: error: 'SOAP_NO_SUCH_ENTRY_IN_ARRAY' undeclared (first use in this function)
286 | case SOAP_NO_SUCH_ENTRY_IN_ARRAY:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
soap.c:290:14: error: 'SOAP_CONFLICT_IN_MAPPING_ENTRY' undeclared (first use in this function)
290 | case SOAP_CONFLICT_IN_MAPPING_ENTRY:
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

@BrainSlayer
Copy link
Contributor

i'm currently fixing it. i also found more compile errors in other sources based on that patch.

@BrainSlayer
Copy link
Contributor

the rename of arg_out_GetMaximumActiveConnections to arg_out_GetMaximumActiveConnection is also wrong. see spec

@BrainSlayer
Copy link
Contributor

i commited 2 patches on top. now it does compile again

@Self-Hosting-Group
Copy link
Author

Thanks for the compilation fix. Unfortunately, I have not yet been able to set up a build environment for dd-wrt.

especially "Server: %s/%s UPnP/1.0 upnpd/0.9.0\r\n" the first arguments for sprintf are osname and os ver. using this has server isnt correct

Could you perhaps take another look at it?

From the UDA 1.1 specification:
Server: OS/version UPnP/1.1 product/version

So a server of DD-WRT/1.2.3 UPnP/1.0 upnpd/0.9.0 should be correct, right?
Another IGD daemon uses OpenWrt/1.2.3 UPnP/1.1 MiniUPnPd/1.2.3

@BrainSlayer
Copy link
Contributor

looks right. os/version etc. is correct. so if practical tests works. all is okay

@Self-Hosting-Group
Copy link
Author

looks right. os/version etc. is correct. so if practical tests works. all is okay

As it is currently: POSIX UPnP/1.0 DD-WRT/61848
Proposed: DD-WRT/61848 UPnP/1.0 upnpd/0.9.0 (if you agree with the daemon version)
OS/version UPnP/x.x product/version

@BrainSlayer
Copy link
Contributor

looks right. os/version etc. is correct. so if practical tests works. all is okay

As it is currently: POSIX UPnP/1.0 DD-WRT/61848 Proposed: DD-WRT/61848 UPnP/1.0 upnpd/0.9.0 (if you agree with the daemon version) OS/version UPnP/x.x product/version

not sure about the daemon version since we have done alot of changes over the years. also not sure if its relevant at all
see r61948 for your proposed changes.

@Self-Hosting-Group
Copy link
Author

Thank you, but I suggested that this would comply with the UDA specs:

- "Server: %s/%s POSIX UPnP/1.0 upnpd/0.9.0\r\n"
+ "Server: %s/%s UPnP/1.0 upnpd/0.9.0\r\n"

@BrainSlayer
Copy link
Contributor

makes technically no different. better now?

@Self-Hosting-Group
Copy link
Author

makes technically no different. better now?

Perfectly, thank you very much.

@Self-Hosting-Group
Copy link
Author

Let's keep this PR open in case I think of any further improvements.

@BrainSlayer
Copy link
Contributor

its not closed. intentionally

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.

2 participants