0ad/source/network
Dunedan a7694ef8b3
Fix adding port forwardings using UPnP
The UPnP implementation included a combination of two subtle bugs, which
resulted in failure to create port forwardings every time after the
first one.

When using UPnP, the internet gateway to create the port forwardings at
needs to discovered. As that takes a while, the its root descriptor URL
was supposed to be cached after successful discovery in the user config
in "network.upnprootdescurl". However, instead of caching the root
descriptor URL, the control URL got cached. That caused following
requests to the root descriptor URL to fail, as they ended up at the
control URL instead. As such requests might also fail when the network
topology changed, the code was supposed to fall back to discovering the
internet gateway again when the cached one didn't work. However, due to
the inner workings of miniupnpc the request using the cached root
descriptor URL didn't result in an error, so the new discovery was never
triggered. As the wrong value was persisted in the user config there was
also no way to get out of this situation again.

This commit fixes both of these bugs.

As far as I can tell these bugs existed since the introduction of the
caching of the root descriptor URL in 0ba25e9968, which means creating
port forwardings using UPnP has been broken since Alpha 15.

(cherry picked from commit 18d7746c84)
Signed-off-by: Itms <itms@wildfiregames.com>
2025-05-15 13:44:35 +02:00
..
scripting GameSettings: ensure savegameID is either a file name or undefined. 2025-01-04 23:19:23 +01:00
tests Enable multiple RequestTypes 2024-12-19 21:36:51 +01:00
FSM.h Make CFsm a template 2024-05-04 16:13:02 +00:00
NetClient.cpp Multicast chat messages 2024-12-28 11:29:08 +01:00
NetClient.h Multicast chat messages 2024-12-28 11:29:08 +01:00
NetClientTurnManager.cpp Replace usage of OSString().c_str() by OSString 2024-10-28 16:35:49 +01:00
NetClientTurnManager.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetEnet.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetEnet.h Use a lower default MTU for ENet hosts, and make it configurable. 2023-04-10 08:21:07 +00:00
NetFileTransfer.cpp Enable multiple RequestTypes 2024-12-19 21:36:51 +01:00
NetFileTransfer.h Enable multiple RequestTypes 2024-12-19 21:36:51 +01:00
NetHost.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetHost.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetMessage.cpp Multiplayer saved games 2024-12-19 21:36:51 +01:00
NetMessage.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetMessages.h Multicast chat messages 2024-12-28 11:29:08 +01:00
NetMessageSim.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetServer.cpp Fix adding port forwardings using UPnP 2025-05-15 13:44:35 +02:00
NetServer.h Multicast chat messages 2024-12-28 11:29:08 +01:00
NetServerTurnManager.cpp Multicast chat messages 2024-12-28 11:29:08 +01:00
NetServerTurnManager.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetSession.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetSession.h Make CFsm a template 2024-05-04 16:13:02 +00:00
NetStats.cpp Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NetStats.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
NMTCreator.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
Serialization.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
StringConverters.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00
StunClient.cpp Reduce time needed for STUN 2024-08-23 21:00:15 +02:00
StunClient.h Revert non-ASCII characters from source and configuration files introduced in 157c6af18e. 2023-12-03 00:30:12 +00:00