From 19629ebf813ef7825eb86a46045ebccdfd484d9a Mon Sep 17 00:00:00 2001 From: Sergey Vojtovich Date: Tue, 7 Mar 2017 15:06:01 +0400 Subject: [PATCH] MDEV-10646 - System Unit File After network-online Bind to an address even if it is not yet configured. --- sql/mysqld.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 90607882aa4..2607307ceee 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -2520,6 +2520,12 @@ static MYSQL_SOCKET activate_tcp_port(uint port) (char*)&arg, sizeof(arg)); } #endif + +#ifdef IP_FREEBIND + arg= 1; + (void) mysql_socket_setsockopt(ip_sock, IPPROTO_IP, IP_FREEBIND, (char*) &arg, + sizeof(arg)); +#endif /* Sometimes the port is not released fast enough when stopping and restarting the server. This happens quite often with the test suite