summaryrefslogtreecommitdiff
path: root/sql/wsrep_mysqld.cc
diff options
context:
space:
mode:
authorAlexey Yurchenko <ayurchen@galeracluster.com>2017-03-03 20:28:27 +0000
committerJan Lindström <jan.lindstrom@mariadb.com>2017-08-11 15:00:18 +0300
commit83664e21e4fb6755c8c0c90d3dee8819d36928c9 (patch)
tree7ae2fbbc4447acfcd09c19598104d95b0de40db5 /sql/wsrep_mysqld.cc
parent5108deded580998db3dbc7f9ef44134caeb42616 (diff)
downloadmariadb-git-83664e21e4fb6755c8c0c90d3dee8819d36928c9.tar.gz
MW-366 Improved support for IPv6 networks - made mysqld and SST scripts to recognize []-escaped IPv6 addresses - pulled in latest Percona and MariaDB updates to SST scripts - instruct netcat and socat in wsrep_sst_xtrabackup-v2 to listen on IPv6 socket via sockopt parameter in the [sst] section of my.cnf
In summary, wsrep_node_address and wsrep_sst_receive_address can now be set to IPv6 addresses escaped by []. Rsync SST works out ouf the box thanks to rsync daemon listening on both IPv4 and IPv6 sockets by default. For xtrabackup SST onver IPv6 one needs to set sockopt in the [sst] section of joiner's configuration file to ",pf=ip6" if using socat as a streamer or to "-6" if using netcat.
Diffstat (limited to 'sql/wsrep_mysqld.cc')
-rw-r--r--sql/wsrep_mysqld.cc22
1 files changed, 6 insertions, 16 deletions
diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc
index cf8ac25aa6a..ad6b8eedf3e 100644
--- a/sql/wsrep_mysqld.cc
+++ b/sql/wsrep_mysqld.cc
@@ -571,27 +571,17 @@ int wsrep_init()
size_t const node_addr_len= strlen(node_addr);
if (node_addr_len > 0)
{
- const char* const colon= strrchr(node_addr, ':');
- if (strchr(node_addr, ':') == colon) // 1 or 0 ':'
+ size_t const ip_len= wsrep_host_len(node_addr, node_addr_len);
+ if (ip_len + 7 /* :55555\0 */ < inc_addr_max)
{
- size_t const ip_len= colon ? colon - node_addr : node_addr_len;
- if (ip_len + 7 /* :55555\0 */ < inc_addr_max)
- {
- memcpy (inc_addr, node_addr, ip_len);
- snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u",
- (int)mysqld_port);
- }
- else
- {
- WSREP_WARN("Guessing address for incoming client connections: "
- "address too long.");
- inc_addr[0]= '\0';
- }
+ memcpy (inc_addr, node_addr, ip_len);
+ snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u",
+ (int)mysqld_port);
}
else
{
WSREP_WARN("Guessing address for incoming client connections: "
- "too many colons :) .");
+ "address too long.");
inc_addr[0]= '\0';
}
}