Question

I was messing around with a UPnP library which I'll be using for a game server. I came to a point where I had to make my addPortMapping-function fail somehow, but since I don't have direct access to the router, I can't turn off UPnP in order to make it fail.

What I did try, in order to make the function fail (which ultimately it didn't), was to try to add a port mapping to port -1.

Now I have the problem of not being able to remove a port mapping from the router to my computer on port -1... As ports can't be < 1, this confuses me.

Is this a known problem?

Was it helpful?

Solution

WANIPConnection:2 specification defines both externalPort and internalPort as "ui2" so they're unsigned integers 0-65535 (internalPort also can't be 0, which is used as wildcard for externalPort). If an implementation accepts -1 it's just broken: So this is not a known problem but a bug in your router. Buggy UPnP-IGD routers in general are a known problem so this is not a surprise.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top