iw4x-client
iw4x-client copied to clipboard
IW4X doesn't respect net_ip - Listens on TCP, not UDP
Both Windows and Linux (WINE) are affected.
My dedicated server has multiple public IPs, binding on the secondary IP via +set net_ip <x>
listens on TCP but you cannot connect in-game (UDP).
The intention is to bind on my secondary (floating) IP so if I upgrade/change service on my provider I don't lose the IP and people's favourites.
Other services I run on the server respect IP binding correctly.
Windows Testing Method
- Assign secondary static IP to main NIC adapter via Network and Sharing Centre
- Added these arguments to start parameters
-dedicated +set net_ip XX.XX.XX.XX +set net_port XXXXX
- Start the server. You should be able to see the server via the HTTP server, however, you should not be able to connect in-game.
Linux Testing Method
- Assign secondary static IP in your distro...
- Follow Windows testing method, but run via
wine
. - Same result, accessible via HTTP, not in-game.
Update/Edit: You'll be able to see the HTTP server, but unable to connect to the game via the IP. It binds on the default or "primary" NIC address; which isn't the expected output/functionality of net_ip
.
Investigated this on behalf of @MrAmos123. This is a multifaceted issue.
- IW4's
Sys_StringToSockaddr
is improperly setting up thesockaddr->sin_addr
value whennet_ip
is supplied (Not sure where it's going wrong, but hooking and reimplementing this routine fixes the issue outright on windows) - WINE compatibility on Linux is inconsistent when attempting to bind the socket with a
net_ip
(Even post-fix) specified (Ubuntu 20.04 with WINE 6 and WINE 5 fails, Debian 11 with WINE 6 also fails, but Debian 11 with WINE 5 or WINE 4 work.
I will attempt to debug Sys_StringToSockaddr
to confirm where and what fails.
Resolved in 0.7+.
Nevermind. This isn't resolved.
Test Environment: OS: Debian 10 Interfaces: 2, DHCP Wine: 7
It fails to bind on a secondary IP address, however, binds correctly using Wine 4.