From 0070f9abad69c67ea47603c516f4e33490aeae2f Mon Sep 17 00:00:00 2001 From: Flyinghead Date: Wed, 21 Jun 2023 16:31:01 +0200 Subject: [PATCH] network: fix known UDP ports bind regression introduced by b4e5af63461b9c2773fe1c9a137333788929d653 Add driving strikers netdemo known port Issue #1112 --- core/network/picoppp.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/core/network/picoppp.cpp b/core/network/picoppp.cpp index a81cd67e5..bc3ef5091 100644 --- a/core/network/picoppp.cpp +++ b/core/network/picoppp.cpp @@ -232,6 +232,10 @@ static GamePortList GamesPorts[] = { { }, { 17219 }, }, + { // Driving Strikers online demo + { "IND-161053" }, + { 30099 }, + }, { // Atomiswave { "FASTER THAN SPEED" }, @@ -1078,18 +1082,8 @@ static void *pico_thread_func(void *) for (u32 i = 0; i < std::size(ports->udpPorts) && ports->udpPorts[i] != 0; i++) { uint16_t port = short_be(ports->udpPorts[i]); - sock_t sockfd = find_udp_socket(port); - saddr.sin_port = port; - - if (::bind(sockfd, (sockaddr *)&saddr, saddr_len) < 0) - { - perror("bind"); - closesocket(sockfd); - auto it = udp_sockets.find(port); - if (it != udp_sockets.end()) - it->second = INVALID_SOCKET; - continue; - } + find_udp_socket(port); + // bind is done in find_udp_socket } for (u32 i = 0; i < std::size(ports->tcpPorts) && ports->tcpPorts[i] != 0; i++)