mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
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.
This commit is contained in:
committed by
Jan Lindström
parent
5108deded5
commit
83664e21e4
@@ -554,3 +554,18 @@ size_t wsrep_guess_ip (char* buf, size_t buf_len)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* returns the length of the host part of the address string */
|
||||
size_t wsrep_host_len(const char* const addr, size_t const addr_len)
|
||||
{
|
||||
// check for IPv6 notation first
|
||||
const char* const bracket= ('[' == addr[0] ? strchr(addr, ']') : NULL);
|
||||
|
||||
if (bracket) { // IPv6
|
||||
return (bracket - addr + 1);
|
||||
}
|
||||
else { // host part ends at ':' or end of string
|
||||
const char* const colon= strchr(addr, ':');
|
||||
return (colon ? colon - addr : addr_len);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user