Describe the bug
--serverpublicip is ignored when a server registers through a UDP proxy or load balancer. The directory always advertises the backend's UDP source IP instead of the declared one, making the server unreachable for clients.
Seems historically --serverpublicip was only added for the same network use case, but I think it should be a general option to register with a given public IP.
To Reproduce
- Put a Jamulus server behind a UDP proxy/LB
- Register with a directory using
--serverpublicip <your-public-ip>
- Check what IP clients receive in the server list — it's the backend source IP, not the one you passed
Expected behavior
Clients get the IP from --serverpublicip.
Screenshots
N/A
Operating system
N/A — directory-side logic issue, OS independent
Version of Jamulus
3.11
Additional context
Root cause is in CServerListManager::RetrieveAll: the wantHostAddr condition always resolves to true for an external client + external server, so LHostAddr (where --serverpublicip ends up) is never consulted.
LHostAddr should take precedence when it is set to a public IP, bypassing the normal routing logic.
Something like an "hasExplicitPublicOverride" (serverlist.cpp):
bool hasExplicitPublicOverride =
siCurListEntry.LHostAddr.InetAddr != CHostAddress().InetAddr &&
!NetworkUtil::IsPrivateNetworkIP ( siCurListEntry.LHostAddr.InetAddr );
bool wantHostAddr = !hasExplicitPublicOverride &&
( clientIsInternal ||
( !serverIsInternal &&
InetAddr.InetAddr != siCurListEntry.HostAddr.InetAddr ) );```
Describe the bug
--serverpublicipis ignored when a server registers through a UDP proxy or load balancer. The directory always advertises the backend's UDP source IP instead of the declared one, making the server unreachable for clients.Seems historically
--serverpublicipwas only added for the same network use case, but I think it should be a general option to register with a given public IP.To Reproduce
--serverpublicip <your-public-ip>Expected behavior
Clients get the IP from
--serverpublicip.Screenshots
N/A
Operating system
N/A — directory-side logic issue, OS independent
Version of Jamulus
3.11
Additional context
Root cause is in
CServerListManager::RetrieveAll: thewantHostAddrcondition always resolves to true for an external client + external server, soLHostAddr(where--serverpublicipends up) is never consulted.LHostAddrshould take precedence when it is set to a public IP, bypassing the normal routing logic.Something like an "hasExplicitPublicOverride" (serverlist.cpp):