MXS-1291: Attempt to bind on 0.0.0.0 when :: fails
If binding on the IPv6 all interfaces address fails, MaxScale will attempt to bind on the IPv4 address.
This commit is contained in:
parent
1df8fda93f
commit
dc849d1c0f
@ -3067,6 +3067,15 @@ int dcb_listen(DCB *listener, const char *config, const char *protocol_name)
|
||||
else if (port > 0)
|
||||
{
|
||||
listener_socket = dcb_listen_create_socket_inet(host, port);
|
||||
|
||||
if (listener_socket == -1 && strcmp(host, "::") == 0)
|
||||
{
|
||||
/** Attempt to bind to the IPv4 if the default IPv6 one is used */
|
||||
MXS_WARNING("Failed to bind on default IPv6 host '::', attempting "
|
||||
"to bind on IPv4 version '0.0.0.0'");
|
||||
strcpy(host, "0.0.0.0");
|
||||
listener_socket = dcb_listen_create_socket_inet(host, port);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user