MXS-1951: Fix port conflict detection
With the addition of SO_REUSEPORT support, it is no longer possible to rely on the network stack to prevent multiple listeners from listening on the same port. Without explicitly checking for the ports it would be possible for two listeners from two different services to listen on the same port in which case the service would be almost randomly chosen.
This commit is contained in:
@ -4087,7 +4087,7 @@ int create_new_listener(CONFIG_CONTEXT* obj)
|
||||
address = "";
|
||||
}
|
||||
|
||||
if (auto l = service_find_listener(service, socket, address, port))
|
||||
if (auto l = listener_find_by_config(socket, address, port))
|
||||
{
|
||||
string socket_type = socket_defined ? "socket" : "port";
|
||||
string socket_definition = socket_defined ? socket : obj->m_parameters.get_string(CN_PORT);
|
||||
|
||||
Reference in New Issue
Block a user