PortMappingListener fails with IGD v2 and ui4 port arguments · Issue #366 · jupnp/jupnp · GitHub
Skip to content

PortMappingListener fails with IGD v2 and ui4 port arguments #366

Closed

Description

@GiovanniMenzano

I got this issue with Forge using jupnp 3.0.3 on a network with a Netgear configured as an access point (192.168.1.2) behind a D-Link gateway (192.168.1.1).

Just for the record, Forge is an open-source implementation of Magic the gathering. The desktop client provides an online multiplayer feature that uses jupnp to automatically configure port forwarding when hosting a lobby.
So, when Forge starts its multiplayer server, jupnp discovers both devices. The RAX10 is correctly ignored because it doesn't expose a compatible IGD service. The D-Link is advertised as an 'InternetGatewayDevice:2' with a 'WANPPPConnection:1' service, but the mapping fails for port '36743'.

Here the exception I got while testing:

18:22:44 [INFO ] FServerManager: Starting Multiplayer Server
18:22:44 [INFO ] FServerManager$ForgePortMappingListener: UPnP device ignored (no compatible IGD WAN service): WPS Access Point [urn:schemas-wifialliance-org:device:WFADevice:1] at 192.168.1.2
18:22:44 [INFO ] FServerManager$ForgePortMappingListener: UPnP gateway candidate discovered: D-Link router [urn:schemas-upnp-org:device:InternetGatewayDevice:2] at 192.168.1.1 using urn:schemas-upnp-org:service:WANPPPConnection:1
18:22:44 [WARN ] DefaultUpnpServiceConfiguration$JUPnPExecutor: Thread terminated org.jupnp.registry.RemoteItems$$Lambda/0x0000028daf6c5ad8@a1d406d abruptly: org.jupnp.model.types.InvalidValueException: Invalid value for (UnsignedIntegerFourBytesDatatype): 36743
        at org.jupnp.model.VariableValue.<init>(VariableValue.java:76)
        at org.jupnp.model.action.ActionArgumentValue.<init>(ActionArgumentValue.java:33)
        at org.jupnp.model.action.ActionInvocation.setInput(ActionInvocation.java:123)
        at org.jupnp.support.igd.callback.PortMappingAdd.<init>(PortMappingAdd.java:44)
        at org.jupnp.support.igd.PortMappingListener$1.<init>(PortMappingListener.java:109)
        at org.jupnp.support.igd.PortMappingListener.deviceAdded(PortMappingListener.java:109)
        at forge.gamemodes.net.server.FServerManager$ForgePortMappingListener.deviceAdded(FServerManager.java:774)
        at org.jupnp.registry.DefaultRegistryListener.remoteDeviceAdded(DefaultRegistryListener.java:50)
        at org.jupnp.registry.RemoteItems.lambda$0(RemoteItems.java:115)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)
jupnp-9 > org.jupnp.model.types.InvalidValueException: Invalid value for (UnsignedIntegerFourBytesDatatype): 36743
        at org.jupnp.model.VariableValue.<init>(VariableValue.java:76)
        at org.jupnp.model.action.ActionArgumentValue.<init>(ActionArgumentValue.java:33)
        at org.jupnp.model.action.ActionInvocation.setInput(ActionInvocation.java:123)
        at org.jupnp.support.igd.callback.PortMappingAdd.<init>(PortMappingAdd.java:44)
        at org.jupnp.support.igd.PortMappingListener$1.<init>(PortMappingListener.java:109)
        at org.jupnp.support.igd.PortMappingListener.deviceAdded(PortMappingListener.java:109)
        at forge.gamemodes.net.server.FServerManager$ForgePortMappingListener.deviceAdded(FServerManager.java:774)
        at org.jupnp.registry.DefaultRegistryListener.remoteDeviceAdded(DefaultRegistryListener.java:50)
        at org.jupnp.registry.RemoteItems.lambda$0(RemoteItems.java:115)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1583)

While the port number is valid, the router describes the port arguments as 'ui4' instead of 'ui2'. Also, the current listener does not accept the IGD v2 device, so Forge cannot create the automatic port mapping and hosting a lobby requires manual port forwarding.

Activity

  1. added a commit that references this issue on Jul 27, 2026
    f3ec271
  2. GiovanniMenzano commented on Jul 29, 2026

    @GiovanniMenzano
    Author

    Hi, any idea when the new version is coming out? I’d like to update the Forge project too

  3. wborn commented on Jul 29, 2026

    @wborn
    Member

    I'll first add a release job to the GitHub Actions workflows and then use that for creating the release.
    Should take less than a week I think. 🙂

  4. added a commit that references this issue on Jul 29, 2026
    1e77668
  5. GiovanniMenzano commented on Jul 29, 2026

    @GiovanniMenzano
    Author

    Perfect! Thanks

  6. wborn commented on Aug 7, 2026

    @wborn
    Member

    Sorry it took a bit longer @GiovanniMenzano. 😊
    You can already try the 3.0.5-SNAPSHOT which is published on Maven Central.
    With #380 creating new releases should be very easy.

  7. GiovanniMenzano commented on Aug 7, 2026

    @GiovanniMenzano
    Author

    Yeah, the Maven Central publishing seems great! Thank you for the update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions