Commit ad5b7b15 authored by Tony Reix's avatar Tony Reix Committed by Anel Husakovic

MDEV-19510 Issue with: sql/wsrep_mysqld.cc : ip_len

Patch `36a2a185` introduced `wsrep_server_incoming_address()` in `10.4`.
Since AIX `/usr/include/netinet/ip.h` header defines `ip_len` as `ip_ff.ip_flen`
and `size_t const ip_len` is preprocessed as `size_t const ip_ff.ip_vhltl.ip_x.ip_xlen`,
to prevent the define from overwriting code in MariaDB,
rename the variable name to `ip_len_mdb`.

This patch is done by Tony Reix <tony.reix@atos.net>.
This patch was submitted under MCA.
Closes #1307
parent 3826178d
......@@ -550,11 +550,11 @@ static std::string wsrep_server_incoming_address()
{
if (node_addr.size())
{
size_t const ip_len= wsrep_host_len(node_addr.c_str(), node_addr.size());
if (ip_len + 7 /* :55555\0 */ < inc_addr_max)
size_t const ip_len_mdb= wsrep_host_len(node_addr.c_str(), node_addr.size());
if (ip_len_mdb + 7 /* :55555\0 */ < inc_addr_max)
{
memcpy (inc_addr, node_addr.c_str(), ip_len);
snprintf(inc_addr + ip_len, inc_addr_max - ip_len, ":%u",
memcpy (inc_addr, node_addr.c_str(), ip_len_mdb);
snprintf(inc_addr + ip_len_mdb, inc_addr_max - ip_len_mdb, ":%u",
(int)mysqld_port);
}
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment